My male working lab 3 years old (not castrated) wees on other dogs.
When we are out on a walk if other dogs come to say hello to him he cocks his leg and urinates on them. It tends to be smaller breed of dogs not ones that are a similar size to him.
It's very embarrassing and now other dog walkers and owners are avoiding me which I totally understand