Is it ethical to require students to participate in an ongoing research study in order to graduate?
If this is a school located in the United States, then no it would not be ethical or legal for this to be a requirement in your program. You quoted from the federal rules quite accurately. Your school is breaking two rules regarding compulsion and anonymity.

Informed Consent


  The HHS regulations state that “An investigator shall seek such consent only under circumstances that provide the prospective subject or the representative sufficient opportunity to consider whether or not to participate and that minimize the possibility of coercion or undue influence” (45 CFR 46.116).


Subjects cannot be compelled or feel undue influence to take a psychological test as part of their educational program:


Unless it served a clear educational reason such as a placement exam (such a placement exam would not be considered to fall within the purview of human subjects testing).
Or, an alternative given. For example, at most universities, first year psychology students are often required to be in the "testing pool" -- however, they need to be given opt out options such as doing library research or other tasks in lieu of the examination. Furthermore, as with all test participants, they can show up for a test and leave at any time without penalty - including before the test begins.


Further reading: https://www.msudenver.edu/irb/guidance/informedconsent/coercionandinfluence/

Privacy and Confidentiality


  "(7) When appropriate, there are adequate provisions to protect the privacy of subjects and to maintain the confidentiality of data." (45 CFR 46.111)


Furthermore,   human subjects must be assured of the privacy and confidentiality of their data. Everyone has the right to have their psych eval score remain private and confidential. This may be a violation of not just the federal rules for IRB but HIPAA as well, since whether you took a medical test or not is in itself protected medical information. 

What to do

If I were at your school, I would make a complaint (either individually or banding together with other students) to the IRB, to the ombudsperson, or to risk management / compliance.   You could also complain to your state or federal Office of Civil Rights, Department of Education,  or Health and Human Services. 

And finally, because you are being to compelled against your will to take the exam and the results are not anonymous, I do not think you have any duty to answer the questions truthfully if you feel that doing so will negatively impact your career. 

The issue of compulsion and corresponding bad data is one reason why psychology is currently having problems with study replication as well as being able to broaden its findings beyond their limited sample populations.