It is a necessity that the Ibadah be for Allaah alone, free from any of the affairs of Shirk(polytheism), for Allaah Says:
َ َََۡۡۡ ۦِﱢَرَءَِْٓاََُۡنَ ََاَََۢأۤۦِﱢَرِةَدَِِۡكََُِۡو ًِٰ۟ـًََ۟
"So whoever hopes for the meeting with his Lord, let him work righteousness andassociate none as a partner in the worship of his Lord."
[Surah al-Kahf: 110]
If anything from amongst the affairs of Shirk mixes with the Ibadah, then it invalidates it -Just as Allaah Mentions:
َنََُْۡاَُ ﱠ ََََُِْۡاََُۡأََۡو
"But if they had joined in worship others with Allaah, all that they used to do wouldhave been of no benefit to them."
[Surah al-An'aam: 88]
Allaah has also States:
َََۡۡإَََِِٔۡۡ َِِﱠٱ َِإَوََِۡإَ ِوُأ
ُۡۡﭑَ ﱠٱَﱢ َُو َِِٰـ
"And indeed it has been revealed to you (O Muhammad), as it was to those (Allaah'sMessengers) before you: If you join others in worship with Allaah, (then) surely (all)your deeds will be in vain, and you will certainly be among the losers. Nay! But worshipAllaah (Alone and none else), and be among the grateful."
[Surah az-Zumar: 65-66]
It is a necessity that the example (to be followed) in the acts of Ibadah and the onewho clarifies it, is the Messenger of Allaah
Just as Allaah States:
ٌٌَََ۟ةَُۡأِﱠٱِلَُر ِ ََُۡنََۡﱠ
"Indeed in the Messenger of Allaah you have a good example to follow."
[Surah al-Ahzaab: 21]