If a university blocks someone who is capable, but lacking pre-reqs, from taking a course there is no real cost to them, and little to the student. (At least for me there were more courses I was interested in taking than I had time to take.)
If a university lets someone take a course without pre-reqs, and that person lacks the required foundation and does badly in the course, it's bad for the student (time wasted) and bad for the university (disruptive to the course, bad in University ranking exercises).
Pre-reqs are not perfect, but it's also hard to assess what all potential students are capable of before before taking a course in the same way that job hiring is difficult. So they are a reasonable approach.
I ended up getting to know one faculty member and having them back me up when I needed it, but it was still a bureaucratic mess every time. Meanwhile in my own major’s department, anyone could basically sign up for any class freely, as long as they agreed to accept the consequences of not being prepared enough.
If retaking a prereq is a huge boost for you, you didn't learn it well the first time.
In many of my early college classes, there were people who already knew most or all of the material and were just there because they had to be.
I guess the rules make sense, but it does seem silly that I ended up better off studying something random and getting a job as a software engineer, than actually studying specifically to be a software engineer.
I'm working on a Masters in Economics right now and laughed when they tried to make me take a pre requisite in college math that covered stuff like functions...when I have a bachelor's in engineering and had to take differential equations and multiple years of calculus. I told them flatly it wasn't going to happen and they rechecked and waived it as not being necessary. In your case, they can't see accredited proof of your years of programming experience and the beauracracy doesn't care enough to let you sit for the exams in the other class.