Let me break up several possible interpretations of your question:
What is the purpose of learning compilation?
There are several possible answers:
- So that you know how to build a compiler should you have to. This is not a good answer nowadays.
- Part of the goal of the computer science curriculum is to explain to you how a computer works, stopping at the hardware. This includes the operating system, file systems, the compiler, the network stack, and more.
- As a programmer, you will be using compilers. Sometimes it will be useful to know what happens under the hood. For example, understanding garbage collection will help you choose which language to use in embedded applications.
- Compilation is part of the standard curriculum, so you might get asked about it in interviews.
Why are they teaching me compilation?
Apart from the reasons listed above, there is an additional one: universities are very conservative. In the past it used to be more important to understand how compilers work. Nowadays this is less important, but change is slow, so material
that made sense 10 years ago is still being taught today.
That said, some universities might reform their compilation curriculum, for example by de-emphasizing parsing, concentrating on more exciting aspects such as optimization, memory management, dynamic and static analysis, and the like.
Why am I studying compilation?
As an aspiring programmer, your university training contains lots of apparently useless classes, for example calculus. People choose to go to university for various reasons - it's a rite of passage, an opportunity for socialization and finding a partner, and it might help you get a job; or even just family or peer pressure.
Some people do away with university training, preferring other formal training, or even self-training. Some of these people are very successful.
For whatever reason, you chose to attend university rather than any of these alternative routes. You should accept that university training is rather theoretical, and try to make the most out of it.