Sometimes I feel very sad when people feel that success is all about having so much money to spend on luxury. Going broke and lacking the ability to provide basic needs is not a good experience and being in debt makes life very difficult and sometimes unbearable. But OP mentioned some notable inventors that were not rich because their main goal was not to make a profit. Most of them just had the intention to use their discoveries to bless humanity.
In my country the mortgage sector is paralytic, hence we don't have a government sector or many private firms that can satisfy the mortgage needs of my countrymen. Most houses in my country are built with personal savings.
Housing can be for personal use or business. Taking a loan to build your own house would be beneficial if the interest rate is low and it helps you to save money that would have been spent on rent. Also, the population of my country is growing rapidly and it has led to high demand for housing facilities. Taking a loan to build a commercial house might be a very profitable investment.