We present a three-dimensional Ising model where lines of equal spins are frozen in such that they form an ordered framework structure. The frame spins impose an external field on the rest of the spins (active spins). We demonstrate that this porous Ising model can be seen as a minimal model for condensation transitions of gas molecules in metal-organic frameworks. Using Monte Carlo simulation techniques, we compare the phase behavior of a porous Ising model with that of a particle-based model for the condensation of methane (CH$_4$) in the isoreticular metal-organic framework IRMOF-16. For both models, we find a line of first-order phase transitions that end in a critical point. We show that the critical behavior in both cases belongs to the 3D Ising universality class, in contrast to other phase transitions in confinement such as capillary condensation.