Your commander can tell you to stay on base but he has to have a valid mission related reason to do so. If you chose to stay off base they may threat to give you paper work, but if you threaten an IG complaint I seriously double they will give you paperwork.
I don't know anyone that has been given paperwork over this terrible policy. It just scares Lts because they don't know any better.
If they did give paperwork and you IG'ed, they would have to defend their policy which they can't because there is not valid mission necessity. You aren't going to do better in the course because you sleep on base.