Why was Yehoshua standing in front of an angel?
Malbim: He was judging him for his deeds.
Why did the Satan stand to prosecute against him?
Rashi: It is because his sons married Nochriyos, like it says in Ezra "va'Yimatzei mi'Bnei ha'Kohanim Asher Hoshivu Nashim Nochriyos mi'Bnei Yeshu'a ben Yotzadak" (10:18).
Radak: "Satan" is a Mashal for Sanvalat and his colleagues, who prosecuted and ceased their work (Nechemyah 3:33-34).
Radak citing Targum Yonasan: His sin stood on his right to prosecute him.
Malbim: One prosecution was for his own deeds. This was already when he was cast in the furnace earlier. The angel judged whether or not he was worthy of a miracle; the Satan prosecuted.
Why was the Satan on his right?
Malbim: The prosecutor stands to the left of the judge. This is to the right of the one being judged, who is opposite the judge.