Why the Puranas sometimes glorify demigods to be supreme
In many Puranas it is sometimes asserted that a demigod is elevated to such a high position that he is almost on an equal level with the Supreme Personality of Godhead, but the conclusion that Lord Visnu is the Supreme Personality of Godhead is confirmed in every scripture. Lord Siva is described in the Brahma-samhita to be like curd or yogurt. Curd is not different from milk. Since milk is transformed into curd, in one sense curd is also milk. Similarly, Lord Siva is in one sense the Supreme Personality of Godhead, but in another sense he is not, just as curd is milk although we have to distinguish between the two. These descriptions are in the Vedic literature. Whenever we find that a demigod occupies a position apparently more elevated than that of the Supreme Personality of Godhead, it is just to draw the devotee’s attention to that particular demigod. It is also stated in the Bhagavad-gita (9.25) that if one wants to worship a particular demigod, the Supreme Personality of Godhead, who is sitting in everyone’s heart, gives one greater and greater attachment for that demigod so that one may be elevated to the demigod’s abode. Yanti deva-vrata devan. By worshiping demigods one can elevate himself to the abodes of the demigods; similarly, by worshiping the Supreme Personality of Godhead one can be elevated to the spiritual kingdom.
Srimad Bhagavatam 4.4.16 purport