If you can't close or lock the door when she comes over, I would tell her that this is her warning....
"That room is not to be played in. Period. If you go into that room, you will be sent home and I won't have you back to play. I will have to call your mom and tell her that you can't play inside anymore."
Don't leave this up to your daughter. Talk directly to the child yourself.
If she asks you a million questions about why she can't go in there, simply tell her that it doesn't matter what your reasons are, NO children play in that room.
I've raised kids and had tons of them at my house and my kids at theirs. It was always a given that no kids ever go into the parents' bedroom and some people even have living rooms that children aren't allowed to play in. That's what the "family room" or "den" was for.
I'm not a mean person, but if kids didn't want to follow my rules when they came over to play, they were sent home and not allowed back until or unless they were willing to do so.
I always made the rules pretty clear up front. And those rules were always subject to change if circumstances warranted.
Best wishes.