A system of atoms connected by harmonic springs to their nearest neighbors on a lattice is coupled to Ising spins that are in contact with a thermal bath and evolve under Glauber dynamics. Assuming a nearest-neighbor antiferromagnetic interaction between spins, we calculate analytically the equilibrium state. On a one-dimensional lattice, the system exhibits first and second order phase transitions. The order parameters are the total magnetization and the number of spin pairs in an antiferromagnetic configuration. On a hexagonal two dimensional lattice, spins interact with their nearest-neighbors and next-nearest-neighbors. Together with the coupling to atoms, these interactions produce a complex behavior that is displayed on a phase diagram. There are: ordered phases associated to ripples with atomic wavelength and antiferromagnetic order, ordered phases associated to ripples with nanometer wavelengths and ferromagnetic order including phases presenting overall buckling of the lattice, disordered glassy phases, and other phases presenting stripes formed by different domains. These static phases are discussed in relation to existing experiments and results for other models found in the literature.