By ordering off the menu, you agree to the price on it. Similarly, when you sign an agreement to pay someone for work done, one would hope you'll pay that person when the work is done. Sadly, reality teaches us that this is not always the case.
(+) this == "You saw the price and consumed the product, now it's time to pay." "But I don't have any money." "Oh fuck. I'm fucked, not you, even though you're the asshole."
Anyway, as far as I can tell resturants are all about experience, and maybe forcing the customer to prove they can pay would degrade the experience to the point where the resturant makes more money by just accepting the occasional dine & dash.
Also in a real resturant if a customer was sitting there baldly refusing to pay, you could probably just call the police (I dont know, I've worked in resturants and have never even heard of this happening).
Regarding the housing comparison, the nature of the credit, the goods exchanged and the fact that maturities are so much shorter in restaurants (1:8)[1], allows (requires) restaurants to engage in riskier business practices. Mortgage lending risks are obviously much more complicated, but you are correct to point out that risk is an inherent part of issuing credit.
[1] Assumes 3 hours credit issued to the average customer, with average inventory borrowed for 30 days.