Once more: nothing subtle here. Mechanicles wants to take over the world for no stated reason, and though he dislikes messes has no problem with creating quite a stupendous mess with his mechanical bugs.
More importantly, Aladdin here becomes an incompetent jerk for no reason but that the plot demands it. He's entirely too egotistical to be believed.
Incidentally, Mechanicles quite reminds me of The Mechanist from Avatar: The Last Airbender. I guess maybe he's fitting a more general 'crazy inventor' character design, but I can't think of others off the top of my head.
Anyway, Aladdin eventually discovers he's been acting like a jerk, and with this realization, becomes once more competent and saves the day.
This is another episode that presents its story well enough, but that fails to be more than mediocre. Why does Aladdin act the way he does? Who cares. Once the episode is over, there's no more need to think about it.