In any creative venture, be it artwork, fiction writing, markup writing, coding, music, film.... the "work" is copyrighted and owned by the creator the moment it is created.
There are only 9 ways the author "loses" rights to the work. William Fisher, of Harvard Law, has an excellent lecture on copyrights. Specifically Lecture 5 part 3 explains the 9 instances where authors do not retain the rights. There is a 10th... if you are an employee or otherwise under a work-for-hire agreement. And an 11th.. if the author gives them away.
So, to that end.. Yes the freelancer owns their creation and can do with it what they want.
Ethical freelancers aren't going to reuse something in whole. It's not uncommon to pull a part form here or there to flesh out something new, but direct duplication is often something most ethical freelancers aren't interesting in doing.
If you fear replication of something you've paid for, a simple solution is to have a contract which transfers partial or all rights of the product from the author to the client/buyer. Most freelancers are more than willing to enter such agreements, however costs may be higher given this factor. Barring such an agreement, the author is free to use the work in any manner they see fit, even if it upsets or bothers the client who paid for the work initially.
It should be noted that freelancers do not have an "employer". Freelancers have clients, not "employers".
Employers tell workers when to work, how to work, what to work on, provide tools for completion of that work, etc.
Freelancers define their own hours, how a project is completed, what projects they will work on, and use their own tools to complete those projects.
Simply because someone pays me to complete something does not make them my "employer", much the same way if I were to hire a plumber to fix my drains, that would not make the plumber my "employee".
The employee <> employer relationship is always a work-for-hire arrangement and the employer owns everything created by the employee.
Independent contracting is often a freelance position. However, there can be contracts defining ownership which can equate to a more work-for-hire agreement in which the contractor (client) owns everything created by the contractee (worker).