It sounds to me like your dog has an anxiety problem going on. I really seriously don't think that your dog is being spiteful in any way. You lock her out of your room, she is nervous and unhappy being away from you and she ends up pottying as close as she can to where you are. It's not a deliberate "I'm mad at you so I'm going to do this RIGHT here" kind of thing. She's upset, and that's a normal way for a dog to act when they're upset.
So what I would do is try to give her another place that can be a quiet happy place for her. This is where having a crate and crate-training your dog really helps. First of all, when you're going to make her stay out of your room, be sure she's just had an opportunity to go out and go potty. Then put her in the new place (crate or a small fenced off area on some linoleum somewhere). Put special "puppy pacifiers" in there with her. These can be raw knuckle bones, kong or other rubber toys stuffed with tiny pieces of dog biscuits and peanut butter or squeeze cheese, etc. You want to give her safe things but also yummy things that she will want to chew on. Put those in with her, turn on a radio for some quiet background music, tell her "goodnight" calmly and walk away.
You can do this some during the day when you're wandering around the house doing things, which also gives you an opportunity to wander by and drop a couple of special treats (tiny pieces of meat or cheese) in with her while she's being quiet. You do NOT want to give her those little treats if she's fussing, but when she's quiet is a perfect time to let her know how proud you are of her.
The way you have things now, she is basically being set up to potty outside your door over and over. If you're punishing her, you are probably just making it worse because she's already upset and you're increasing that stress. By changing the situation, giving her a safe place to be, and no longer allowing her access outside your door then you're on the right step to controlling her anxiety.
Good luck!
Melanie and the gang in Alaska