Yes. One of the most common purposes for purchasing Life Insurance is to cover a mortgage. Term Life Insurance is the most common type of coverage for this situation.
this should not be confused with mortgage insurance that is offered by the lender at the time of purchase. Mortgage insurance is meant to cover the lender and will decrease over time. Term Life Insurance is meant to protect the homeowner and is usually much cheaper than mortgage insurance.