Praise be to Allah.
If the conditions and essential parts of marriage are fulfilled – namely the proposal and acceptance, and the consent of both spouses – and the marriage contract is done by the wali (guardian) or his proxy in the presence of two witnesses, then this is a valid marriage, even if it is not documented. This is one of the forms of ‘urfi marriage. But documenting the marriage in our times is obligatory, so as to protect the rights of all concerned, namely the husband, the wife and the children. If it is not documented, then it is haraam because this obligation has been neglected. So the marriage is valid, although the one who did it without documenting it is sinning.
This is what is meant by something being both valid and haraam. This is in contrast to getting married without a wali, which is haraam and is not valid.
If the wife is not concerned about her rights and does not want to have children, this does not waive the obligation of documenting the marriage. She may deny that this man is her husband, in which case the husband’s rights will be affected. She may die, and her husband will not be able to inherit from her, so his rights will be affected. She may have a child even though she does not want to have children, and the husband will be unable to register the child’s birth, so the child’s rights will be affected. He may marry her and stay with her for a while, and then leave her but refuse to divorce her, so she will be left hanging, unable to marry someone else or take him to court to resolve the matter.
The view that it is obligatory to document the marriage is clearly sound, and the interests served by that are many and obvious. The negative consequences of neglecting to document the marriage are very well known, especially in these times in which there is a great deal of denial of duties and rights, and causing people’s rights to be lost, especially as some regulations governing family law make it binding on the courts not to listen to the claims of spouses or to issue rulings concerning them without submission of official documentation. This is how the courts have been operating in Egypt since 1931, as stated in Article 99 of a list of instructions to sharia courts, which was amended by Law no. 78 in 1951. … Another such legal example is Kuwaiti family law, where it states in Article 92, paragraph (a): The court will not consider any case in the event of denial of marriage by either spouse, unless the marriage is proven by official documentation, or the denial is preceded by admission of marriage in official papers.
End quote from Mustajiddaat Fiqhiyyah fi Qadaayaa al-Zawaaj wa’t-Talaaq. Usaamah ‘Umar al-Ashqar, p. 145.
In the past, people did not need documentation, because there was less dishonesty and mischief.
Shaykh al-Islam Ibn Taymiyyah (may Allah have mercy on him) said: The Sahaabah (may Allah be pleased with him) did not need to write down mahrs (dowries), because they did not delay part of the mahr; rather they paid it in full immediately, and if they did delay some of it, it would be well known. But when people started to marry with a delayed portion of the mahr, to be paid after a long time, and it would be forgotten, they began to write down the delayed portion, and that became proof of the mahr and that the woman was indeed his wife.
End quote from Majmoo‘ Fataawa Shaykh al-Islam (32/131).
And Allah knows best.