There are a number of reasons for dressing in disguises on Purim. The simplest one is that it is a remembrance and thanksgiving of how G-d saved us while still staying anonymous. How behind the scenes G-d caused a miracle. G-d was “masked,” so to speak — disguised as “nature” — so we also disguise ourselves, to remember this.
Another reason is to highlight the concept that even the Gentiles disguised themselves, pretending to be Jews. The Megillah thus says: “And many of the people of the land professed themselves to be Jewish, for the fear of the Jews had fallen upon them.” (8:17) They pretended to convert to Judaism, but didn’t actually. We know this because the term used in that verse is “misyahadim,” — “Judaized,” instead of “misgayarim,” — “converted.”
They merely masqueraded as Jews. Thus, the custom has arisen to masquerade ourselves on Purim, to commemorate the miracle, whereby a complete turnabout caused the Gentiles to fear us and not kill us, as they had originally planned.