R’ Shmuel HaLevi Wosner (Shu”t Shevet HaLevi, Vol. 9, siman 202) writes: In regard to Hilchos Tzedokah there is no obligation to buy an apartment, as the Gemara only mentions “renting” a house. Even if you will argue that buying an apartment is included in, די מחסורו – “providing a poor person with what he needs”, as without an apartment there is no shidduch, one can still buy a cheap apartment far from the city center, and there is no obligation to provide for a poor person the same thing that one would give a rich person, as is clear from the Meiri (Kesubos 67b): שכל מה שנותנים לו הוא בצמצום גדול- “That which we give him is done exactingly and we don’t give extras.”
He concludes: If, however, the shidduch won’t go through as they want an apartment in a central city, then once again it becomes די מחסורו – “providing a poor person with what he needs”.
[This Teshuvah was written 31 years ago, on erev Shabbos Parshas Toldos 5754, between then and today there has been drastic changes in property prices, and today making a shidduch without promising an apartment has become more accepted, and therefore, it may no longer be considered .די מחסורו]
The Shu”t Minchas Yitzchak (8:72) writes: There is no need to donate money except for the basic necessities, and a fancy apartment is not considered a basic necessity. However, he adds: Sometimes living in a chareidi neighborhood is considered a basic need.
R’ Menashe Klein (Kuntros Pa’amei Yaakov, Vol. 67, pg. 167) speaks about this at length and he concludes: For a chosson who is an am ha’aretz [ignoramus] it is forbidden to obligate oneself and to give more than the basic needs for the chasunah, and it is forbidden to collect tzedokah from the community - doing so is stealing from the public. However, to marry off a daughter to a talmud chochom, even though one could marry off his daughter to a simple boy for less money, he is allowed to obligate himself to pay more, and ask for tzedokah to be able to do so!!!