Superconducting circuits are a competitive platform for quantum computation because they offer controllability, long coherence times and strong interactions-properties that are essential for the study of quantum materials comprising microwave photons. However, intrinsic photon losses in these circuits hinder the realization of quantum many-body phases. Here we use superconducting circuits to explore strongly correlated quantum matter by building a Bose-Hubbard lattice for photons in the strongly interacting regime. We develop a versatile method for dissipative preparation of incompressible many-body phases through reservoir engineering and apply it to our system to stabilize a Mott insulator of photons against losses. Site- and time-resolved readout of the lattice allows us to investigate the microscopic details of the thermalization process through the dynamics of defect propagation and removal in the Mott phase. Our experiments demonstrate the power of superconducting circuits for studying strongly correlated matter in both coherent and engineered dissipative settings. In conjunction with recently demonstrated superconducting microwave Chern insulators, we expect that our approach will enable the exploration of topologically ordered phases of matter.