They teach you syntax because it's easy to grade. Grading a student on how well they navigated a messy, real-world bug or how cleanly they commented code is much harder for a professor.
That is an incredibly sharp insight, Faiq. Academia scales things by making them standardized and easy to check. Unfortunately, real-world engineering is inherently messy, subjective, and hard to put into a simple grading rubric.