It is not compulsory, but it is the first thing we recommend when you buy a home. You do not know how many copies of the key there are or who has them: previous owners, tenants, relatives, the agency or whoever did the cleaning.
With a new cylinder, the only keys that open the door are yours. And there is no need to change the lock: the cylinder is enough, and it is a quick job.
It is a good moment to improve security a little. Many homes, especially resales, have basic cylinders of the kind fitted as standard. You can take the opportunity to fit a security one or key all the doors alike.
The same goes if you have inherited a house or are going to rent one that has had other tenants. It is all in cylinder replacement.