We don't have to consistently choose every intervention that benefits the group over some individuals, we can evaluate them one by one and pick and choose.
This is why a democracy without a very strong republican and individual rights constraints is nothing but soft-core communism.
It's an ages old question of what happens if 11 boys of the class unanimously vote that all 10 girls should attend the lessons topless.