Update:
I just saw a Gemara at the very end of chapter 7 of meseches Yoma. See the last three lines of that chapter and the second to last Rashi! Explicit proof.
Great intriguing question. I just read a little further in that same Rambam you quoted and it seems as though the Rambam holds that Yehoshua was appointed as the official King over the nation:
Chapter 1 Halacha 3 of Hilchos Melachim and Milchamos:
אֵין מַעֲמִידִין מֶלֶךְ בַּתְּחִלָּה אֶלָּא עַל פִּי בֵּית דִּין שֶׁל
שִׁבְעִים זְקֵנִים וְעַל פִּי נָבִיא. כִּיהוֹשֻׁעַ שֶׁמִּנָּהוּ משֶׁה
רַבֵּנוּ וּבֵית דִּינוֹ. וּכְשָׁאוּל וְדָוִד שֶׁמִּנָּם שְׁמוּאֵל
הָרָמָתִי וּבֵית דִּינוֹ
At first, a king was not appointed other than by the Court of Seventy
(Sanhedrin) and with the consent of a Prophet. So was Joshua appointed
by Moses our Teacher and his Court, and Saul and David by Samuel the
Ramathite and his Court.
(Quoted from Sefaria)
So from this, it sounds like he was appointed as the official King.
Now granted he wasn't called Yehoshua Hamelech like Dovid Hamelech or Shlomo Hamelech or Shaul Hamelech, but maybe that was just a naming convention he didn't take on for whatever reason.
In response to Al Berko's comment:
Hi, it seems you are raising 3 points.
- When the Rambam said 'K'Yhoshua' he didn't mean that Yehoshua was actually made king by Moshe, rather the Rambam was comparing a kings anointing process to the process that Yehoshua went through to become a general leader.
- Yehoshua was not from the tribe of Yehuda and therefore could not have been officially king.
- There are no Mefarshim that say that the Rambam holds that Yehoshua was officially king, so this would lead us to think that the Rambam doesnt actually think that Yehoshua was officially king.
I would respond as follows:
- I would agree with what you're saying if the Rambam stopped after the first comparison with Yehoshua. If he would have stopped there, then I could hear that he is saying "Just like the process Yehoshua went through, to become a general leader.
'Just LIKE Yehoshua who Moshe APPOINTED'
From the fact that the Rambam continues with the comparison to David and Shaul, in the exact same way he does the comparison to Yehoshua, seems to me that the simple understanding in the Rambam is that he holds Yehoshua was actually made king by Moshe just like David and Shaul were made king by Shmuel.
'Just LIKE Yehoshua who Moshe APPOINTED'
'Just LIKE Shaul and David who Shmuel APPOINTED'
"We only appoint a King through B'D of 71 and a Prophet, just like Yehosua, Shaul and David were appointed by a B'd of 71 and a Prophet"
With regard to point 2): Im not exactly sure what you're saying, it seems you yourself agree that Shaul was officially king without being from the tribe of Yehuda, rather from Binyamin. Yehoshua was also from the tribe of Binyamin. You can see this answer and the other answers there which explain how it is not set in stone that the official king of the Jewish nation has to be from the tribe of Yehudsa.
With regards to point 3): If it actually is the simple understanding in the Rambam that Yehoshua was officially made King, then I wouldn't expect any other mefarshim to corroborate that. Meaning I would only expect someone to speak up if they disagreed. I think from the fact that no other commentators disagree that is actually proof that everyone agrees with the Rambam.