You do not need a visa if you are a British national. You are allowed to stay there for 90 days without a visa requirement. However, I'm not sure about the exemption if you buy a property. As far as I'm aware, there is no such rule or regulation that exempts you. But I may be wrong.
Just to confirm, European nationals are free to enter Morocco without restrictions for up to three months on any one visit. For longer stays, property owners may apply for a permanent visa. With the government looking to encourage foreign ownership, long term visas for property owners are simple to obtain once you have your title.