We numerically investigate a coupled map lattice model which is a generalization of the critical height sandpile automaton. In the case of periodic boundary conditions we find in dependence on a threshold parameter strong evidence for a second order phase transition between states of different spatial order. In the disordered phase the spatial structure is irregular with long range linearly decaying correlations. In the ordered phase dynamics is dominated by a few coexisting periodic attractors whose basins of attraction become infinitely small at the critical point. At this point transient lengths diverge and the transients are chaotic. With open boundary conditions the system exhibits self-organized criticality, i.e., adjusts itself to the vicinity of this critical point.