Title insurance is put in place to cover a home owner in the event that a troubling legal ownership question arises that was not found during the initial title search. For example, if a previous deed was forged or possibly a property line issue rears its ugly head(you don't own as much of your yard as you thought) the title company that preformed the original search will pay all fees associated with defending the title search. This issue scarcely ever takes place but when it does the possibility of the home owner loosing their property is very real so its always wise to protect yourself. The bank, or lender will also insist on title insurance at your expense.
Mortgage insurance protects the lender (usually a bank) against the risk of nonpayment by the buyer. There is no benefit to anyone except the lender. Mortgage insurance protects the lender in the case that the home owner defaults on their home loan in which case it can reduce or even eliminate the risk of loss to the lender and is required for all loans were a less than 20% down-payment is required.