If your charge is running into your boss's offices multiple times a day, then you are actually not even doing the job you are being paid to do. Instead of calling you out on this, they are offering a solution that will make it easier for you to do your job. The locking of doors is immaterial. I have little kids. Even if my door is locked, it's distracting if they are turning the knob or banging on it trying to get in. Our kids' nanny knows that, and she makes efforts to prevent it from happening in the first place.
Personally, I would have told you the office thing was a problem and suggested we brainstorm together on a solution, as it might feel less dictatorial to you. But that's my perspective.