All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The Prophet said: “... Therefore, whoever makes Hijrah (migrates) for the sake of Allaah and His Messenger, then his Hijrah is for Allaah and His Messenger (i.e. it is accepted). And whoever makes Hijrah for the sake of a worldly gain, or a woman [whom he desires] to marry, then his Hijrah is for the sake of that for which he made Hijrah.” [Al-Bukhari and Muslim on the authority of 'Umar ]
In his commentary on this Hadeeth, An-Nawawi said: “It means that whoever intends the Countenance of Allaah by making Hijrah, then he will get the reward from Allaah, and whoever intends a worldly benefit or to marry a woman, then this is what he gets and he has no share of this Hijrah in the Hereafter.”
Ibn Mas’ood said: “There was a man among us who proposed to marry a woman called Umm Qays, and she refused to marry him until he made Hijrah, so he made Hijrah and married her, and we used to call him Muhaajir Umm Qays [lit. 'he who migrated for Umm Qays'].”
It was said that the Prophet made this statement on account of this incident as related by Ibn Mas’ood.
Hijrah from a non-Muslim country to a Muslim country is an act of worship which is deemed either obligatory or desirable. Hence, if a person intends to obey Allaah by making Hijrah and he also intends to marry a woman in that country, then the ruling that applies to such a person is that of someone who combines the intention of worship and the intention of getting a worldly benefit.
Shaykh Ibn ‘Uthaymeen divided such an act of worship into three categories:
1. If his intention of worship was predominant, then he misses only the complete reward.
2. If his intention was mostly for something other than worship, then he gets no reward in the Hereafter, but his reward is only what he gets from this world, and I am afraid that he might be sinful by doing so.
3. If the matter is equal for him in a way that neither of the two intentions dominates the other, then this has to be looked into. The more correct opinion is that he does not get any reward, just as the one who does an action for the sake of Allaah and for the sake of others.” [Majmoo' Al-Fataawa]
Allaah Knows best.