There is nothing wrong in standing up for the national anthem in Muslim countries for such standing is no more than a simple expression of one’s loyalty and patriotism.
As regard non-Muslim countries, the issue cannot be considered categorically Haram; this is due to the fact that when Muslim citizens of these countries stand for the playing of their national anthems, they don’t intend to tacitly approve the un-Islamic rulings prevalent in those countries. Thus, their act falls within the domain of performing a national duty, i.e. loving one’s nation.
In this regard, Sheikh Faysal Mawlawi, deputy chairman of the European Council for Fatwa and Research, states: “Muslims living in non-Muslim countries are to respect the symbols of those countries such as the national anthem, national flag etc. This is part of what citizenship dictates as per modern customs. I’d like to make it clear that there is a far cry between this simple form of showing loyalty and the other forms acts that imply a blind loyalty to un-Islamic regimes, overlooking the hostile trend adopted by those regimes against Muslims. It is worth mentioning here that the Prophet, peace and blessings be upon him, spent more than thirteen years in Makkah without showing any form of disrespect to the symbols of polytheism. For him, it was enough not to participate in the pagan rites prevalent in that society and he warned the people of Quraysh against worshipping them.
Thus, standing up for the national anthem is not a form of prohibited loyalty. If a Muslim is to change a wrong action in a majority non-Muslim country, let him do that through Da`wah, wisdom and fair exhortation. At the same time, he should not obey any rules that involve disobedience to Allah.”
Moreover, Sheikh `Atiyyah Saqr, former head of Al-Azhar Fatwa Committee, adds:
“There is nothing wrong with standing up for the national anthem, for that reflects one’s respect and loyalty for one’s country. This patrioritic act has nothing to do with worship as there is neither prayer nor Dhikr. Thus, standing up for the national anthem is neither a Bid`ah nor a show of loyalty to others than Allah.”