The supreme administrative court ruled against the right of Hossam Ezzat Mussa and his wife, Rania Enayat, to state their religion on official documents.
The couple had filed their case in 2004 and a lower court ruled in their favour in April this year. In May, however, the decision was suspended by the supreme administrative court pending an appeal by the interior ministry, and the couple's identity cards were confiscated.
Enayat said: "Those who belong to this religion are apostates of Islam, because the faith's principles contradict the Islamic religion and all other religions."
Saturday's verdict throws the status of Egypt's Bahai community into limbo, in a country where carrying identity papers at all times is required by law and essential for access to employment, education, medical and financial services.
Without official identity cards, Bahais cannot apply for jobs, buy property, open bank accounts or register their children in schools.
Human rights organisations condemned the court's decision. Hossam Bahgat, director of the Egyptian Initiative for Personal Rights, who has closely monitored the case, said: "It's a regrettable decision, but it's a crisis for the government more than for the Bahais.
"Now the government is forced to find a solution for the hundreds of citizens who have no papers."
Bahgat said the judge did not respond to any of the legal arguments but instead discussed the tenets of the Bahai faith, which fell outside the scope of the lawsuit.
Bani Dugal, who represents the Bahai community at the UN, condemned the decision as a violation of human rights. He said: "The court's decision threatens to make non-citizens of an entire religious community, solely on the basis of religious belief.
"Our hope now is that the public debate over this issue will cause the Egyptian government to rectify its discriminatory policies."
Despite the fact that Bahais have been in Egypt for as long as the religion has existed, 163 years, most Egyptians had not heard of the religion until the April ruling.
Under Gamal Abdel Nasser, Egypt's late president, Bahais were suspected of collaborating with Israel because the faith's highest governing institution is based in Haifa.
In 1960, Bahai assemblies and institutions were dissolved. The judge in Saturday's hearings reiterated the accusation. He said: "One of the first goals of the Bahai movement is to maintain their relationship with the occupying powers, which embraces them and protects them."
Of the faith's 12 principles, which include the unity of mankind, the elimination of all forms of prejudice, gender equality and independent investigation of truth, it is obedience to government that is most highlighted in Egypt.
Egyptian Bahais do not join political parties, take part in demonstrations or hold elections for their spiritual assemblies.
Labib Hanna, professor of engineering at Cairo University, recently said: "We don't want to cause problems. We just want to exercise our rights as Egyptian citizens."