As soon as I turn off the last light in the house every night, if I forgot to take the dog (a 13-year-old miniature dachshund we obtained from a reputable breeder 11 years ago) out immediately prior, the dog will wake up within an hour and indicate he has to go out.
If I do not take him out, he will urinate on a bathroom throw rug. Occasionally he will try to drink / lick up whatever is caught in the carpet fibers. He has water and food available to him and he seems to eat well.
We have a dog door, but he does this action after the house is shut for the night (we live in an area where many other types of critters could potentially enter said door when it is not monitored). He uses the door just fine, it is that he urinates inside while we're all asleep, and he has to go because either we took him out immediately before going to bed earlier than normal, or we just forgot to take him out before bed.
I don't think he's ashamed of having done what he's done, but he could be; I suspect he is bored.
Why is he doing this? He doesn't do this when he goes in the grass; he doesn't even turn around to acknowledge it when we're outside; granted, it's already soaked down, but it should smell the same.
It's not his going inside that concerns me; I understand why that happens. It his cleanup / drinking that is baffling.