In most cases, the truth is that getting homeowners insurance on a house you don't have a legal claim to isn't smart. It may not even be a good idea to do so, even if your heart is in the right place. Should you make a claim on the home, there may be a chance that you won't see the money. Moreover, filing the claim can bring up more problems than it would solve. Most of the time, the only person who will benefit from homeowners insurance is the person who bought the house. If you aren't sure whether or not you should ensure a place that isn't yours, it's best to talk to your insurance agent or your real estate agent.
They'll know what you should do, and may be able to offer up an alternative that will be more fiscally sound for all parties involved.