You don't have to be friends with your coworkers. That's the simple answer. But if you stop there, you miss the nuance of what actually makes working with people work.
The people you work with are not your family. They did not choose each other the way friends do. They were assembled by a hiring process and a job description, and somewhere along the way they ended up in the same space trying to accomplish the same goals.
What you actually need with coworkers is not friendship — it is trust and respect. Those are not the same thing, and you can have both without ever grabbing a drink after work or knowing the names of someone's kids.
Trust means they know you will deliver on what you say. Respect means you treat their time and contributions as valuable. Both of those things can exist in a purely professional relationship, and they are far more important to your career than whether you genuinely like the people you work with.
That said — the quality of your relationships at work directly affects the quality of your work. People go above and beyond for people they like. They cover for people they trust. They give honest feedback to people they respect enough to be straight with.
You do not have to be best friends. But you do have to invest enough in the relationship to create the kind of environment where people actually want to work with you, not just tolerate you.
So no — you do not need to be friends with your coworkers. But you do need to be someone worth working alongside. That is the real standard.