Systematic study of stacked square nets: From Dirac fermions to material realizations