The ruling on marriage depends on the circumstances, marrying can be either obligatory, recommended, permissible, discouraged or forbidden. See Is it permitted to not get married?
As for a man who can not have coitus due to some reason (العنين) such as because of disease or old age or lack of sexual desire, or lack of interest in a certain woman etc. Then marriage is still permissible for him. Some have even stated that it is recommended.
من لا شهوة له، إما لأنه لم يخلق له شهوة كالعنين، أو كانت له شهوة فذهبت بكبر أو مرض ونحوه، ففيه وجهان؛ أحدهما، يستحب له النكاح؛ لعموم ما ذكرنا. والثانى، التخلى له أفضل
Those who have no desire, either because they were not created with any desire, such as one who is impotent, or they had desire but it has disappeared due to old age, sickness and so on. There are two opinions: First: It is recommended to get married because of the general meaning of what we have discussed. Second: It is better for him to remain single
— al-Mughni translation from islamqa
The disposition of the man may change after marriage or his ailment may be cured. Or the couple might desire other benefits of marriage such as companionship, assistance, provision of accommodation and financial maintenance or intimacy other than intercourse etc.
However the wife should be informed and have agreed to it. That is because intercourse (at least once) is a right of the wife and can not be taken away from her against her will, see Sex deprivation: How long is it permissible for a husband to not have sex with his wife?. If the situation is not known and discovered later then the following can happen:
- the wife can voluntarily choose to remain with the husband
- the wife can ask for khula' (divorce) from the husband if he agrees to it
- the case will be brought to a court who (according to the majority) will give the husband a grace period of one year to get treatment etc. If he is still unable to perform and the wife still demands separation then the judge will cause a separation between them by commanding the husband to give divorce or by invalidating the marriage if he refuses. Note however that the case of a man who can not have intercourse because his penis has been cut off (مجبوب) is different as that can not be changed with time. In this case the separation can be immediate.
https://www.islamweb.net/ar/fatwa/107546/