It is legitimate if, in a single course, there are two "classes" of students taking the course for different forms of credit (such as a course with undergrads taking the course for undergrad credit and grad students taking the course for grad credit, or majors taking a course with students majoring in something else), it is legit for the prof to deliberately and transparently hold the different "classes" of students to different standards. This should be made clear to students registering for the course and should be made clear on the first day and on the course syllabus.
The best and most legitimate way to make this distinction is, even if the course is taught together with the same prof, is for the different "classes" of students to register for, what appear to be different courses with different course numbers in the school catalog or schedule. So seniors would be registering for ECON 458 and grad students would be registering for ECON 558. The "two" courses happen to be about the same topic, meet in the same room at the same times, are are taught by the same prof. But that prof can assign assignments to the students expecting grad-school credit that is not assigned to the undergrads. And that prof can apply a stricter measure of performance to the grad students.
Other than that, the same standards should be applied to every student throughout the course.