As usual, to answer this question we need to step into our comparative linguistics-fueled time machine and go back to Proto-Indo-European times, so we can see what function the ending -a, which we know as a neuter plural ending, had in PIE.
In PIE, this ending -a (or rather *-(e)h₂) did not form plurals, but collectives. A collective refers to a group of objects, but is conceptualized as being a single thing, and for grammatical purposes is generally treated as a singular noun; this was probably the case in PIE, and is why in Greek, for example, neuter plural nouns in -a still take singular verbs.
PIE collectives seem to have been used most often with neuter nouns -- in fact, neuter nouns don't seem to have had a normal plural (at least not in the nominative/accusative), so the collective form more or less stood in for a plural. This is why in Latin and other languages, -a came to be a specifically neuter ending.
But the collective could also be formed from masculine and feminine nouns. Locus is one such example: of its two plurals, locī continues the PIE plural, while loca continues the PIE collective. Lewis and Short describe the difference in meaning as follows: "plur. loci, single places; loca, places connected with each other, a region" -- where the plural vs. collective meanings are clear. Locus actually isn't the only such noun in Latin: there's iocus "joke", pl. ioca, and carbasus "sail", pl. carbasa. And there's at least one case in which the collective was reinterpreted as a feminine singular: pila "ball", which seems to have originally been the collective of pilus "hair" (meaning "mass or ball of hair").
(By the way, another heterogeneous noun with a similar story behind it is frēnum "rein", pl. frēnī. In this case the Latin masculine plural ending continues what was in PIE terms not a plural at all, but a neuter dual.)