Evolution of cooperation driven by diversity on a double-layer square lattice