The main purpose of the facility was to isolate and treat the handful of individuals who had been diagnosed with criminal insanity. In the late 2260s, the asylum was overseen by Governor Donald Cory, and contained 15 patients, including the notorious Fleet Captain Garth of Izar.
Because the facility housed dangerous patients, the asylum was equipped with extensive security precautions including force fields protecting the patient's living quarters, and the colony dome was protected by a field that prevented Elba II's toxic atmosphere from rushing in, and protect the asylum from phaser fire.
However, the stringent security measures didn't preclude the possibility of prisoners trying to escape, as proved by Garth in 2268. In this year, the shapeshifting Garth managed to trick Governor Cory and have complete run of the facility, but was unable to escape the asylum. Even after capturing Captain James T. Kirk and Commander Spock of the USS Enterprise, Garth and his followers were unable to escape.
Once Garth's rampage had been ended, the Enterprise delivered a revolutionary new drug to the asylum in the hopes it would reverse the arterial and brain damage and rehabilitate the inhabitants of the asylum. (TOS episode: "Whom Gods Destroy")