Why not get rid of job titles and just have people do whatever needs to be done?
Because no one person is good at everything, and even if you managed to build a team of people who were good at everything, it is inefficient to make everyone keep up with all details of every aspect of the company so that they can be productive in an arbitrary role at the drop of a hat. Giving people a role allows them to specialize their knowledge and concentrate all their efforts into their area of expertise/competence.
Managers fill a role. Sure, some managers are bad, and some workplaces have seemingly mostly bad managers, and it leads to cynical opinions about how managers are busy-work-making dolts who don't understand anything. Some employers have mostly good managers and I feel sorry for you if you have never had the experience.
I'm 40 years into my EE career and I have always deflected efforts to make me a people manager or a project manager. I like being a grunt in the trenches solving problems at the bottom level, and a good manager increases their reports' productivity by shielding them from needing to deal with project management crap. I would have retired already except I've been blessed to have good managers for the past 20 years, while my managers have been attending umpteen resource allocation meetings and all the attendant report-making that requires.