We hear a lot about today about how students don't show respect for their professors. Well, respect is a two-way street, in which teachers also need to earn the respect of their students.
Students do have major responsibility for being motivated, but faculty can still help a great deal.
Enforce prerequisites, but make clear what students are expected to know going in. Be on time with grading of homework and exams. Insist that they answer. In general, be reflective and self-critical of your lectures. Don't let students show lack of respect to other students.