Surface codes, the 2D classical Ising model, and non-interacting fermions