Why am I taught theory that I have no idea how to apply in practice? I am a third year Computer Science student. The question that I reach out to you with is featured in the title.
There are some lectures that make me ask such questions. For the sake of this discussion it is worth noting that I am also working as a developer.  
It may be true that the first (at most) two lectures try to introduce a new field of study in a way that somehow speaks to me (I affiliate that with a feeling that a new segment is being build onto my mind and the way it holds on are at first only a few nerve connections between the segment and my brain). However, the concepts introduced next stop falling into place. In order to deal with that I've tried reading books that take up a given field of study in a scholarly way and the effect seemed to be similar. 
Another approach that I've taken is studying tests from previous years in order to see what are the key problems the lecturer is trying to convey. Now, that can only work provided that the teacher himself intends to create the test focusing on those points, which is not always true. Regardless, in most cases the tasks focus on small differences between two (or more) very similar notions which during these 3 years I have observed in practice only a couple of times. 

The problem with the last point is that if those small differences are to be noticed at all it has to happen now, and not when I have working experience of 5 years, because I won't remember them then.

In other words: How is it, that despite being active professionally in the field I am studying and working on projects for university lectures it is so hard to find connection between practice and the theory taught during lectures?

Or pessimistically: What is the point of studying this way if there is one? How to make it beneficial for me?
I cannot vouch for CS, but in my field (physics) learning the theory is useful in order to construct yourself a starting basis for your future studies and research. 

You can still do valuable work without knowing much theory in my field. For example, the lab technicians, in general, don't know much theory, but can still perform a measurement. To obtain an X-ray spectrum for a sample, you put in on the holder, and you tell the computer to shine the X-rays. Then you get the spectrum. You take the spectrum, you load it into the program that compares it with the computer spectrum and see if the crystal that the chemists synthesized indeed has that structure. 

But, doing research is more complex that just performing a measurement. You have to be able to invent new things and to not miss something new that someone in your lab just discovered. Supposed one of your graduate students or the lab technician comes to you with some new data they say it "looks weird". Based on what you know from your research experience and from your theory background, you should be able to decide if they should do the measurement again, because the result violates some conservation laws you learned as an undergraduate, or because it really looks like they are onto something new.

As a computer scientist, you may not need all the theory you learn. It wasn't my case as a physicist. I needed more theory than I learned and I'm still learning some. Depending on what level you work, you would need more, or less theory. If you just want to develop code in a company, you won't need that much. Where I live, people become programmers by just attending boot camps. But, if you want to develop cutting edge stuff, you knowledge base has to be broad. You have to come up fast with ideas like the fast inverse square root. Without a serious theoretical background, it's doubtful you would come up with such things.