“Why do people think they own code just because they’ve paid for it? PC Pro’s Kevin Partner says many of his clients believe that by paying for the work to be done, they take ownership of it. But, put simply, code is owned by its developer even once the client has paid, unless that developer is legally employed by the client or a contract exists that transfers full ownership (and even then it’s far from clear-cut). He discusses the thorny issue of making clients understand that distinction and gives advice on how developers can assert their rights.”
I think there’s a distinction to be made. Are we talking about when a client comes to a developer and asks for a new website? In a situation like that I always understood that the client owns the code, assuming it was all written for them. Clearly if something like WordPress is used then they would only own the custom template.
However, if the client is using a service provided by the developer, a hosted content management system perhaps, then it’s logical that the client doesn’t own the code.
Then they don’t own it because if they owned it then they would be able to decide for themselves what use they (and you) could do with it. Whoever owns it can do what they like with the code. Everyone else must abide by the conditions set by the owner.