Motivating students when teaching a widely disliked course
There are many ways to motivate students, including but not limited to


showing practical relevance of the course
explaining what makes the teacher passionate about the subject
linking the course topic to their own experience
actively engaging the students in discussions
giving the students adequate tasks and providing them with rapid and positive feedback (adequate = not too difficult and not too easy)


Some tips and tricks can be found on http://serc.carleton.edu/NAGTWorkshops/affective/motivation.html