How to balance learning and solving assignments during coursework
You may be interested to know that this problem doesn't go away when you finish classes.  It's easy to struggle with the same question when you're doing research.  Simply put, you don't have time to learn everything.  You need to estimate how important a topic will be to your future studies (and future research).  

Similar to what you're describing, I feel a sense of security when I can reproduce the details of all the relevant proofs.  However, taking this approach to everything I learn is simply infeasible.  Perhaps you can take comfort in telling yourself that for the stuff that is most important, you'll reread it later and learn it in more detail.  The difficulty is that right now you most likely can't really tell which material will be most important (to you).  

As I continue to listen to talks and read more papers (or take more classes, at an earlier stage of my career), I watch for which ideas keep coming up.  When I hear about a topic repeatedly, I often become convinced that it's really worth learning in depth.  In the time between first seeing a topic and finally sitting down to really understand it, I'm also likely to learn about many connections to other areas, which give me more motivation.  In addition, I often grow in intellectual maturity, which makes it much easier to grasp ideas that were quite challenging the first time around.