Given a finite quandle, we introduce a quandle homotopy invariant of knotted surfaces in the 4-sphere, modifying that of classical links. This invariant is valued in the third homotopy group of the quandle space, and is universal among the (generalized) quandle cocycle invariants. We compute the second and third homotopy groups, with respect to "regular Alexander quandles". As a corollary, any quandle cocycle invariant using the dihedral quandle of prime order is a scalar multiple of Mochizuki 3-cocycle invariant. As another result, we determine the third quandle homology group of the dihedral quandle of odd order.
All Science Journal Classification (ASJC) codes