It's adventurous and done for shock value! Boys, boys, boys....
My son did something similar at age 6. I even caught him urinating in the trash can in the garage at age 10. I wonder if it isn't some sort of sense of adventure. When my son urinated on the carpet in his room, she let me know that her son did the same thing behind the couch at about the same age. He is now a well adjusted adult. Maybe he is just testing some boundaries. Good luck and God bless.
This is something that my brother used to do when he was a little boy. He would go in his trash can in his bedroom, with the bathroom right next to his room! My mom took his trash can out of his room and that seemed to help. He is a normal, fully functioning adult, who knows where to use the restroom.