Homeowner's insurance is a safety measure that is insisted upon by the mortgage company but the law does not require it. In general, most mortgage companies and lenders will require you to have a homeowner's insurance that covers the value of the loan. In case of disasters or damage to your home, a homeowner's insurance protects you as well as the lender.
In case you live in a disaster prone area like a flood zone or an earthquake zone, lenders will require you to have a flood or earthquake insurance policy on your property. Common areas of buildings where your condo, town home, or apartment is located might require a homeowner's insurance policy as dictated by the homeowner's board.
While it is not mandatory to have homeowner's insurance, it is prudent to establish this type of insurance. Even if you don't owe any amount on your mortgage at all, a homeowner's insurance plan will give you the peace of mind knowing your investment in your home is covered even if disaster were to strike. If there is any destruction or damage to your property, you will not be looking at a complete loss. Protecting your largest investment should be a priority and homeowner's insurance is the best way to accomplish this.