In the US, there is title insurance. If the seller didn't have the legal right to sell the house, the house reverts to the legal owner, and the buyer is paid back by the insurance. It's not possible to get a mortgage without title insurance, and a cash buyer would be nuts to not demand it from the seller. In some states (example, California) it can get more complicated, though, because the right to sell a house isn't…
This seems backwards. To evict someone you have to swear up and down that you're going to occupy the place yourself. People get prosecuted for e.g. doing an owner-move-in eviction and then selling to a developer. The old owner doesn't have a legal basis to get rid of the tenant, but the new owner does.
Where do you get this from? It's not like any US law I've ever heard of.
For the evictions I've worked on, the homeowner simply wanted the tenants out (non-payment, etc) so they could re-rent or sell the property. They didn't ever have to live there.