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.
To understand this hadith, one has to understand the Islamic concept of qadar (divine preordainment). One of the essential tents of Islamic belief is to believe in qadar.
A Muslim has to believe that Allah knew everything about His created beings (all that happened and all that will happen) before their creation and that He wrote this down in a Heavenly Preserved Writ.
Everything thus comes to pass as already written. This does not mean at all that human action is caused by what is written in the Heavenly Writ. Allah is in no need to force anyone to do good or evil by interfering with his/her will. Human actions are done by human will and thus man will be held accountable for whatever he/she has actually said or done.
No one may take Allah’s prior knowledge of human actions as an excuse to justify evil and sinful acts. Anyone who thinks this way should be asked: Will you accept this as an excuse from someone who has beaten you, usurped your property, or killed your child?
If this is a valid argument, why should we punish criminals who committed crimes already written in the Heavenly Writ? Of course, no sound-minded person will ever accept this argument.
The questioner is advised to read more about the Islamic belief of Qadar from authentic sources. He is also advised to take all possible means to get married. He should know that he is in a test and, to pass it, he needs to trust Allah, pray earnestly to him, show full submission to his commands and believe that
“Indeed, with hardship comes ease.” [94:5].
Besides, Almighty Allah said what means,
“Allah does not change a people’s condition until they change what is in their souls.” [13:11]