This is a duplicate question of 24308. In Tolkien's legendarium, the Mines of Moria (Khazad-dum) were built by the Dwarves, specifically by Durin the Deathless. The Dwarves were renowned for their underground craftsmanship and mining. The other races (Orcs, Elves, Hobbits) did not build Moria.