In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Sister in Islam, it gives us great pleasure to receive your question, which is a sign of your interest in Islam and its teachings. May Allah guide us all to the straight path!
Islam, as a divine religion, pays great attention to the importance of conviction for those who embrace it. Therefore, it lays down the principle that there is no compulsion in religion. In the same vein, it doesn’t accept conversion for other objectives such as marriage.
In this context, we recall the Prophet’s Hadith in which he (peace and blessings be upon him) rebuked a man who migrated from Makkah to Madinah to marry a certain woman, for he gave priority to worldly interest over the great merits of Hijrah, and thus he lost a great reward. The Hadith says, “Actions are but by intention and every man shall have but that which he intended. Thus he whose migration was for Allah and His messenger, his migration was for Allah and His messenger, and he whose migration was to achieve some worldly benefit or to take some woman in marriage, his migration was for that for which he migrated” (Al-Bukhari and Muslim)
Focusing more on the question you posed, Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
A person must never embrace Islam solely for the purpose of getting married to a Muslim woman; Islam does not sanction such conversions.
Conversion to Islam, in order to be considered as genuine, must proceed from one’s inner conviction and should be based on one’s own free choice. Allah says, “There shall be no compulsion in religion: Truth stands out starkly clear from falsehood.” (Al-Baqarah 2:256)
If, therefore, at the time of conversion, a person did not have the intention of seriously considering the religion for practice, then such a conversion is simply invalid and unacceptable. Whoever is making this gesture is simply deceiving himself and wronging his own soul as he can never deceive Allah who knows not only what we do, but also what we cherish in the innermost recesses of our hearts.
When a person says upfront that he is simply taking the Shahadah (saying that there is no god but Allah, and Muhammad is the Messenger of Allah), and yet he has no intention of practicing Islam, then in reality he is not embracing Islam at all but is merely making a show of conversion for wooing the girl he wants to marry.
Allah Almighty knows best.
Excerpted, with slight modifications, from: www.islam.ca