Social media does some harm. Being socially excluded does far _more_ harm. Which starts to happen in middle school.
So as a parent, you have three choices:
1. Deal with the emotional consequences of your kid being systematically excluded and having few/no friends.
2. Construct an alternative school/community with like-minded parents and kids.
3. Just give them the damn device, with screen time restrictions and the understanding that you'll be monitoring their activity. Follow through and be involved in their social life, with open and honest conversations about what happens online.
It turns out most good parents these days opt for #3.