The Rambam in Sefer haMitzos (362) goes a step further and writes that we know from Nevi’im (not from Ya’akov Avinu) that only Shlomo and his descendants, malchus beis David, have a legitimate claim to malchus. The appointment of anyone else is like a zar trying to serve as a kohen and a violation of “lo tuchal la’seis alecha ish nochri.”
What makes this Rambam strange is that the Rambam himself in Hil Melachim (ch 1) writes that any king appointed by a navi who observes Torah and mitzvos is a legitimate king. And in Hil Chanukah, unlike Ramban who is critical of the Chashmonaim because as Kohanim they had no right to the throne, the Rambam lauds the Chashmonaim for re-establishing the malchus. How does this fit with what the Rambam tells us in Sefer haMitzvos? How can there be a legitimate king who is not from malchus beis David?
I want to look at another nice chakirah and then maybe through that come back to this Rambam.
The gemara (Krisus 5) writes that malchus is passed b’yerushah from father to son; therefore, the son of a king does not need to be anointed. Why then, asks the gemara, was Shlomo anointed? The gemara answers that this was special case because of the machlokes with Adoniyahu as to who would take over.
Yesh lackor what the conclusion of the gemara means. Does it mean that:
1) malchus passes b’yerusha no matter what, but where there is machlokes a new meshicha is needed to quiet the dispute;
2) machokes interferes with and cancels the din yerusha; therefore a new meshicha is needed to re-establish the king's right to the throne.
Rambam (Melachim 1:12) writes:
אין מושחין מלך בן מלך. אלא אם כן היתה שם מחלוקת או מלחמה מושחין אותו כדי לסלק המחלוקת.
Sounds like the first option – there is still a din yerusha, but you have to do something to quell the machlokes.
Rashi in Kerisus, however, explains “… aval ki ikka machlokes *lo yerusha hi*.”
Sounds like the second option – there is no din yerusha in a case of machlokes.
Maybe the underlying issue here is what purpose meshicha serves. According to Rambam, meshicha creates a permanent status, much like the meshicha of a kohen gadol endows the kohen with a certain kedusha, or the meshicha of a kli shareis endows it with kedusha. It is a transformative experience. Machlokes cannot undo that status. According to Rashi, however, meshicha is more of a symbolic gesture, like wearing a crown or carrying a scepter. It’s doesn’t transform the essence of the person -- it's just a symbol of the position.
Coming back to the Rambam we started with, R’ Meir Dan Plotzki in Chemdas Yisrael (here) suggests that according to Rambam in Sefer haMitzvos the issur is not *appointing* a new king, but rather in *anointing* a new king. It's the meshicha that creates the issur, not the minuy. The Chashmonaim and others who might have ruled were temporarily holding the position, but since they had no meshicha, their claim to the throne was incomplete and there was no issur violated. Perhaps this is the Rambam l’shitaso in our chakirah, that meshicha transforms and is "mekadesh" the person (Rambam himself in Sefer haMitzvos draws the analogy to kehunah) to fill the role of malchus. Without that, the king is just an ordinary person playing a role.