Theory of hastatic order and its defect states