Why did Abraham worship the moon, sun, and stars and yet not get labelled as a polytheist when if someone did that today, they would be committing shirk?
I understand you refer to the following verses of the Holy Qur'ān:
(Remember) when Abraham said to his father Azar: You Take idols for gods? Lo! I see you and your folk in manifest error. Thus did We show Abraham the kingdom of the heavens and the earth that he mighty be of those possessing certainty. When the night grew dark upon him he beheld a star. He said: This is my Lord. But when it set, he said: I love not things that set. And when he saw the moon uprising, he exclaimed: This my Lord. But when it set, he said: Unless my Lord guide me, I surely shall become one of the folk who are astray. And when he saw the sun uprising, he cried: This is my Lord! This is greater! And when it, set be exclaimed: O my people! Lo! I am free from all that you associate (with Him). Lo! I have turned my face toward him Who created the heavens and the earth, as one by nature upright, and I am not of the idolaters. [6:74-9]
A careful study of the verses would reveal that the prophet Abraham (sws) did not worship these heavenly bodies nor did he express his belief in them. Rather he adopted a very effective way to reveal upon his addressees that what they worshipped were nothing. This is the way he exposes the absurdity of the beliefs of his addressees. We know that once he had damaged the idols of his nation he told them that perhaps the biggest idol had broken the others. No one will say that he actually believed that the biggest one had done so. Similarly here he does not express his belief in the sun or the stars. He wanted to expose the absurdity of the idolatry beliefs and for this he uttered these words. Thus at the appropriate time he was able to make them realize that a man of thought could not indulge in worshiping lifeless and helpless creation rather only the Almighty is to be worshipped who created all these things which are subject to rules set for them by their creator.