The question isn't whether or not the states should be "allowed" to do that, it is whether or not such power is reserved to them under the Constitution. I don't see anywhere in the Constitution where it says that the right of the people to masturbate is inviolate or that the right to masturbate is an inalienable right or that the power of the States to ban masturbation is curtailed. Perhaps that was one of the grievances against King George, oppressive restrictions on the right to be a wanker; but Jefferson and Adams didn't mention it in the Declaration of Independence. Maybe Madison was too embarrassed to include notes about the right to masturbate in his notes of the Constitutional Convention. Or maybe it was just a backroom deal when the post-Civil War debates on the 14th Amendment were going on. You know, well, we can knock out those laws against masturbation at the same time we try to prevent state laws from oppressing the newly-freed slaves. Great constitutional moments.
I suspect that if you went to your local mall, seated yourself in a stall and engaged in such conduct, you might find yourself being prosecuted. I would say, however, that under the 4th Amendment the States have no power to search your home without probable cause to see if you are a wanker. On the other hand, seeing this post of yours might give them probable cause to suspect that you are indeed a wanker.
Do you really believe you could find any state legislature that would want to even consider such a law? Even if you did, don't you think the voters might install some new legislators at the next election and encourage them to spend their time on more pressing matters? That's the way our system of government should work.
Nice try, though.
I would bet you three cases of beer that you couldn't find any state legislature today which would want to even consider a law against sodomy, heterosexual or homosexual.