Military buildings blighted by criminal behaviour to be turned into housing