ye 'py anya-devatā-bhaktā yajante śraddhayānvitāḥ te 'pi mām eva kaunteya yajanty avidhi-pūrvakam

ye 'py anya-devata-bhakta
yajante sraddhayanvitah
te 'pi mam eva kaunteya
yajanty avidhi-purvakam
"Whatever a man may sacrifice to other gods, O son of Kunti, is really meant for Me alone, but it is offered without true understanding."
Demigods are also living entities and parts and parcels of Krsna. Therefore in one sense one worships Krsna when one worships the demigods, but not in the proper way. There is a proper method to water a tree. One should water the roots, but if one waters the leaves and branches instead, he is simply wasting his time. If one worships the demigods to the exclusion of Lord Visnu, his rewards will only be material. As confirmed in Bhagavad-gita: