Using ideology or party registration as a quota mechanism surely violates the First Amendment. It also is an utterly horrific idea.
It also would lead it dissembling. Hey, Boalt Hall, I am a Federalist Society MAGA Pub, so you have to let me in to fill that quota! Yes, last year I was a Dem, but that was just my socialist phase. You know, when young to be a conservative means you have no heart, while when adult, to be a socialist means you have no brain. I become an adult this year. And I can write as well as Churchill to boot. Just saying.
As the Virginia Statute for Religious Freedom noted in reference to requirements that officeholders be of certain faiths:
[It] tends only to corrupt the principles of that very Religion it is meant to encourage, by bribing with a monopoly of worldly honours and emoluments those who will externally profess and conform to it;