You can still sort classes by ability (setting) to better align teaching with pupil's aptitude for certain subjects yet have people able to socialise across broader groups of friends. That then allows for people who are really good at a couple of subjects but not at others to do well where they can, whereas throwing them into a school for broadly less able (or more able) wouldn't help them. One of my friends got three science A levels but had to redo their GCSE English to get into university. They'd never have got into a grammar if that situation was in place (they were quite disruptive at junior school too, but grew up a bit later on - measuring kids at a certain age doesn't help people like this).
The grammar school argument smacks of targeting resources at better able and fuck the rest. Some Free Schools are the same. It's championed by parents who don't want their kids to have to mix with 'oiks', who would probably love to buy their kids out of socialising with people they consider lesser than them but can't afford the fees of private schools.
They're also missing out that adult education and proper apprenticeships with day release by committed employers was one of the reasons for post-war social mobility, that's how my Dad got on in life (via ten years at night school). That sort of thing went down the toilet when we moved to a model of transient employment with little investment in worker education, you're supposed to buy that yourself at university if you can now.