There are many potential reasons that your dog may be displaying this behavior that may seem so rude to humans. Here are the reasons that dogs sleep with their bum facing you.
A big part of why your dog may sleep with its bum facing you may be that they trust you. Facing away from you is a solid signal that your dog is not worried that you might attack them.
Dogs have scent glands near their tails, and they may be using those glands to mark you with their smell. Many pets like to combine their scent with their owners to create a hybrid pack smell.