The jnAni as he is, must have already descended to this world of duality and decided to raise the commonfolk to his level.
He who knows that the source of all this duality is that Infinite Compassionate Godprinciple, would ipso facto have no compunctions for making a hymn of praise for that Ultimate in Its saguNa form.
And he also knows that it is that very same Power that prods him on to make this hymn. So where is the contradiction here?
But if you contend that he is writing jnAna works for the benefit of the world loka-sangrahArtham without any kartRtva-buddhi -- the awareness of doership then with the same non-awareness of doership he can write both jnAna works and bhakti works.
What and where is the difference? The World-welfare (loka-kalyANam) is the purpose.
It is the Lord who is effecting the welfare through the hands and mouth of these chosen jnAnis.
And the most efficient way for the jnAni, the Lord knows, to reach the masses, is to propagate hymns of praise of the divine, pilgrimage to holy centers, installation of mystic yantras, and all the way down to ritual worship.