Degrees of freedom refer to the parameters of a node that may vary independently of each other. In a structural analysis, a node may have up to six degrees of freedom – Three translations and three rotations (one each in X, Y, and Z direction).
3D elements have three DOF – Translations in X, Y, and Z directions. This means that that FE solution contains displacement information, but no rotational information. This is appropriate because 3D elements possess volume. Hard values of rotations are not required (and may not work well numerically) to capture the behavior of the geometry accurately. The translations of the nodes would capture the rotation of the volume.
Beam and Shell elements (2D line and 2D surface elements) lack the spatial fidelity of their 3D counterparts. But they somewhat “make up” for this by having 6 DOF. The translations and rotations are explicitly calculated to represent the physical behavior of a geometry.