Sort of. I mean, this isn't a simple picture (unfortunately.)
I mean, the theoretical answer is: No, your boss can't tell you who you form friendships with. And they can't dock your work performance based on a factor that's not work related.
But... it's more complicated than that. Imagine you simply ignore your boss. And your boss pulls you into the office three weeks later and indicates you've been put on a Performance Improvement Plan because of some minor errors you've made in the last week. It's probably them angry about you continuing your friendship. But good luck proving that. Good luck spending your time and mental effort fighting it, and then fighting back against any other efforts your boss might spend trying to make your life miserable. The sad truth is: if you don't have a good relationship with your boss, you're generally not going to have a good time - even if everything is 100% on the boss' side of the fence.
So where does this leave you?
Option 1: Drop the friendship. Personally, I think this is a lousy option. But it's there. One thing that you should consider, though is... maybe the supervisor has some piece of info that is hidden from you. Not saying this is the case, but what if the supervisor witnessed suspicious activity, or signs of drug usage, or something similar. Don't get me wrong - I'm NOT saying this is the case, or that this should be the option you should default to... but at least give a second thought as to if there might be some additional reason they're making this request of you. You might consider asking them why they're so opposed to your friend - is it simply performance based or is there something more going on.
Option 2: Ignore the boss, continue the friendship as-is. Unfortunately, this is a bit of a dangerous route, and you may need to keep in the back of your mind the idea that you'll eventually need to transfer somewhere else. There is one good note, though: once your friend is let go, it's likely that the strife point gets far less blatant. I mean, it's one thing if the supervisor sees the two of you chatting in the breakroom; it's a lot less visible if the two of you are simply hanging out after work somewhere away from school.
Option 3: Challenge the Assumption. This is the route I'd probably recommend. Basically, push back against the assumption that you'll end up being a less valuable employee if you remain friends with your buddy. Redouble your work ethic, and make it blatantly obvious that you're one of the best teachers around - and make sure you're letting your quality be visible upwards.