A two weight inequality for Calder\'{o}n-Zygmund operators on spaces of homogeneous type with applications