The gemara is actually a mix of Mishnaic Hebrew and Aramaic.
- Quotations from Mishnayot and braytot are mostly in Hebrew (except for some really old Tannaitic sources.)
- Statements from named Amoraim are sometimes in Aramaic and sometimes in Mishnaic Hebrew, presumably quoted in the language they stated it.
- Statements from the narrative voice of the gemara, known as the stama degemara, are usually in Aramaic. This might be from Ravina and Rav Ashi, or might be from later, from the 'stammaim' (perhaps Savoraim or perhaps even early Geonim).
I don't know if this was the intention, but the language is helpful in distinguishing the narrative glue from the other statements, almost as much as color coding or a different font would be helpful in this regard.
At the time, Aramaic was the lingua franca in the Jewish world, perhaps more so than Hebrew. Recall that they had a Meturgeman in the shul for leining, because many many people did not know Hebrew but did know Aramaic. They spoke Aramaic in their daily speech, and did so in the major Jewish population centers.
This was not the case after Jews spread out to other countries. While one could point to certain Judeo-Arabic works, such as the Moreh Nevuchim, written in Judeo-Arabic, I would guess there were many Jews who did not speak Judeo-Arabic at the time, and so they turned to Hebrew and Aramaic as a common tongue.
Here is a discussion of Judeo-Arabic literature, including some halachic literature. One interesting quote:
While many halakhic responsa by Spanish Jews were penned in Arabic, legal compilations were composed in Hebrew or hebraized Aramaic. Even Maimonides, who wrote most of his works in Arabic, turned to Hebrew for his magnum opus, the compendium of Jewish law entitled Mishneh Torah or Ha-Ḥibbur. However, as an aid to making his great compilation well-arranged and complete, he prepared in Arabic a list of the 613 commandments before embarking upon his enterprise. He provided this propaedeutic because he had his own ideas, which differed from those of his predecessors, on the nature of the laws which ought to be included in the 613. He insisted, for example, on the need to distinguish between a biblical and a rabbinic prescription and to exclude general admonitions, such as "Be ye holy." By laying down these principles of selection he hoped to establish an unchallengeable list, a hope that was not fulfilled.