It depends. There are some topics for which the historical context provides the perfect motivation. Which problems were considered important and why? How does this theory solve these concrete problems? It is much easier to motivate students to learn about abstract theories if you can clearly explain their usefulness ahead of time.
However, there are some mathematical theories, e.g. Topos theory, whose historical context is so convoluted that it's just going to confuse students. I'm speaking from personal experience here... Historically, Topos theory was developed in the context of algebraic geometry. This context is not (directly) useful to you if you want to apply these ideas to logic. If you approach the topic from order theory instead (which is an application that came much later historically!), you get a very smooth explanation where every step follows from what you did previously instead of magically teleporting in place from disparate areas of mathematics...
However, there are some mathematical theories, e.g. Topos theory, whose historical context is so convoluted that it's just going to confuse students. I'm speaking from personal experience here... Historically, Topos theory was developed in the context of algebraic geometry. This context is not (directly) useful to you if you want to apply these ideas to logic. If you approach the topic from order theory instead (which is an application that came much later historically!), you get a very smooth explanation where every step follows from what you did previously instead of magically teleporting in place from disparate areas of mathematics...