A person must never embrace Islam solely for the purpose of getting married to a Muslim. Islam does not sanction such conversions. However, if anyone says the Shahadah, then we accept his or her conversion even though his or her intention might be impure.
Sheikh Muhammad Nur Abdullah, president of ISNA (Islamic Society of North America) and member of the Fiqh Council of North America, states the following: First of all, a person cannot put a condition for his or her conversion, i.e., that he or she is embracing Islam just to get married to so-and-so. This is not accepted when stipulated and clearly stated. However, if anyone says the Shahadah, then we accept his or her conversion even though his or her intention might be impure, as we are supposed to deal with people based on what they show us and Allah takes care of their real intentions that they hide inside themselves.
Even if someone converted and he or she was not fully convinced in the beginning, but later on we explained Islam and helped him or her to become a better Muslim and the person showed better behaviour and faith, then it is accepted. We know that when Hamzah (may Allah be pleased with him) converted, he in anger said to Abu Jahl, “How can you hit him (Prophet Muhammad (peace and blessings be upon him) when I am following his religion!” [He said so when he had not yet declared his Islam and he was angry because his cousin Muhammad (peace and blessings be upon him) was hit by Abu Jahl]. Then after that he thought about Islam and he later became one of the best Muslims in history.
Therefore, we should not question people’s faith in Allah. Rather, we deal with them as they say and behave, and if they hide insincere intention, then it is Allah Who will take care of them.