I lock rooms in my sims houses so the guest don't wander to use whatever random objects by themselves or randomly find themselves in my sims secret dungeons (unless ofc i want that)
and as for apartment giving key system i mostly use it for neighbors with benefits ;)
but thats just cause i had planted hot dude next doors and he kept showing up at my sims house in towel claiming his shower is broken.... dude we know you had other motives
also sometimes i have multiple households on one lot so I'll make it so they cant access each others houses
but i dont think giving key gives sims access to locked rooms its supposed to just make it so your sims dont have to greet before those sims come in and the sims use your house all they want