The general secular morality standard would be ‘do no harm’. By this standard, if an activity is dangerous to others or harms others, then it should be illegal. Masturbating in public is pretty threatening around others, but not in private. As to why taking a dump in public is treated as a less serious offence, that is probably a combination of the influence of traditional judeo-christian morality and the fact that, unlike masturbating in public, defecating in public is merely disgusting, rather than an indication that someone is a dangerous sexual pervert who is a hairs breadth away from progressing on to committing a serious sexual assault or rape...
“The general secular morality standard would be do no harm.”
I’d take issue with this reasoning. This is not the general secular morality standard, it’s nothing more than Alistair Crowley’s “Do What Thou Wilt” philosophy restated. Most people don’t agree that this is the only standard, because we don’t accept that things which cause harm to one’s self are morally acceptable.