Generally speaking, people use other people's money (OPM) to leverage their earnings.
If you can make (conservatively speaking) more money somewhere else, then you can go for a mortgage. Age should be considered as well - as most people try to pay off their mortgage by their retirement.
To give you an idea: 400K mortgage 3.75% interest 30 yr fixed P&I = $1,852.46 Interest paid over 30 yr period $$266,886. If the term is 15yr fixed and rate is 3.5% P&I = $2,860, interest paid over 15 yr period $114,715.
Besides money market fund (not that great of an interest, especially considering inflation), there are many other investment options for you.
F.e. investment of your self-directed IRA (SD IRA), real estate investments of different kinds...and more...
In the end of the day, besides math, you got to be very comfortable with whatever choice you make.
Hope this helps,
Beachfront Realty, Inc.