You seem to already realize that this is a subtle question. When I taught Mathematics early in my career, I also forbade students to work together. Later on, teaching Computer Science, I found myself at the opposite pole. I normally forced students to work together on nearly every task. In some ways I changed, but it was more that the subjects are different. So, I learned to (try at least to) match the student activities to the kind of thing they needed to learn and understand.
In some courses personal insight is essential and hard-gained. Much of math is like that. The student needs to grok the ideas deeply so that they can be integrated into a whole so that the frontier of knowledge can be pushed forward. If students work together in such courses, it is inevitable that one of them will have the key insight first. A-Ha. From that point the collaborators are really just watching someone else work and will be denied the experience of overcoming the block themselves. Since those blocks are frequent in math, overcoming them is an important skill in its own right. Some CS topics also have this same nature, but most do not.
As you note, most work in industry is done in teams and team members share insights with one another. In fact, Pair Programming is specifically designed to force insight sharing. But as you also note, you sometimes need to work alone and so you need the skill to do that. But Pair Programming also fosters this skill as the Driver and Navigator roles swap frequently. One way to bring a newbie up to speed is to have him/her pair with a veteran. The experienced programmer could probably build everything alone but surprisingly often benefits from the fresh insight of the new hire. Since team-work is a learned skill, I think the university should help the students learn it.
In graduate education, things may be a bit different, but again, it depends on the course. More work is likely to be individual at this level as it is more likely to be insight-rich. Certainly by the dissertation level the student needs a lot of experience working through their own tasks. But even here, discussions between dissertation-level students working on different problems can be valuable in seeing how some things can be approached.
I worry mostly that forbidding collaboration in the classroom raises the stress/tension level in students. I hope there aren't many who see this as a good thing. Students have enough stress anyway and I think we faculty should work to reduce, not increase, it.
The faculty that forbids collaboration of any kind is probably a bit naive about what really happens outside their line of sight. Students no longer live in monastic cells. They meet. They talk. It seems better, in my view, to recognize this and to guide it.
One top US college at which I taught has an honor code in which students can collaborate on projects without limit as long as they share no code. Students can ask others for clarifications and advice. Students formally sign this code as a condition of acceptance to the program and it is kept on file. There are a few violations, of course, and the college treats them as a really big deal, with expulsion as a possible punishment. It isn't automatic, however, and review committees are permitted to show mercy as appropriate.
I've taught important courses in which the first task is to break up the students in to teams of 4-5. All of their work, with one exception, was done in collaboration and we (there were two professors) provided collaboration tools so that the students could easily meet in virtual space as needed. The one exception was an individual project that was done (take-home) over the period of one week. This project might have been related to the overall team project, or not, but it had a similar "flavor" in any case. The teams were encouraged to bring their less experienced members up to speed prior to this task and the teams took pride in the success of their members. Many of the "newbies" struggled with this, but a few had really dramatic improvements.
In other courses in which most work was collaborative and most of the grading depended on group project work, there were one or two fairly low pressure exams that counted for a small part of the grade. In total it was about enough to raise/lower the marks by one level, A <-> B, say. But one full level change would be extraordinary unless the student simply skipped the exam. Collaborative exam prep was neither encouraged nor discouraged. I assume that the best students were more likely to collaborate in prep than others, but have no data.
One advantage of collaborative project work in the classroom is that students can work on larger projects than would otherwise be feasible. Time becomes less of a constraint. Seeing large projects with many parts is a good thing, even if you primarily work on only one part of it.
One of the issues that some faculty have with collaboration is that it can be difficult to determine who the chief contributors are so as to provide appropriate rewards (and sanctions, of course). This needs to be planned for. There is a concept (and Pedagogical Patterns) about Peer Evaluation that are worth exploring. It is quite easy to do and can be structured so that it is a positive experience for students. Students can be encouraged to reward their best and most helpful team mates. I once also learned that a particular student who appeared to be disengaged in the class was actually the chief contributor to a team and that I'd likely misjudged him.
Please don't weaponize these comments against your faculty. It won't do you much good to be seen as a contrarian.