Any landlord can sell at any time, yeah. However, if a tenant is still in place when the sale concludes then the new owner has to honour the terms of the existing tenancy.
The landlord doesn't NEED to evict a tenant just to make a sale other than to be a dick about things.