So, like, for the bulk of history, the people demonizing it are religious assholes.
They demonized sex out of wedlock, demonized wanking off; and any other kind of sexual release, while simultaneously deciding who you can marry (and therefore have kids with,).
It’s one of their core methods of social control, ensuring wealth is only passed on to children of wealthy and “faithful” families.
They also practiced polygamy, so that rich and influential men would have multiple wives and poor men would have none. Imagine the rage when you were a Shepherd tending someone else's flocks, knowing that you will never have a wife or family.
It makes sense to have occasional wars with neighboring tribes so that excess males can be removed from the system.