There are places where this doesn't make sense, and there are times where it absolutely doesn't make sense, but present day is a lot different. My anecdote of paying less (or slightly more) in mortgage + associated versus rent is not all that uncommon these days.
The real hidden cost, if you ask me, is the way it changes your sense of mobility.