The distinction between primary and secondary constraints is not a very fundamental one. It depends very much on the original Lagrangian which we start off with. Once we have gone over to the Hamiltonian formalism, we can really forget about the distinction between primary and secondary constraints.
In Hamiltonian mechanics, a primary constraint is a relation between the coordinates and momenta that holds without using the equations of motion (Dirac 1964, p.8). A secondary constraint is one that is not primary, in other words it holds when the equations of motion are satisfied, but need not hold if they are not satisfied (Dirac 1964, p.14). The secondary constraints arise from the condition that the primary constraints should be preserved in time. (A few authors use more refined terminology, where the non-primary constraints are divided into secondary, tertiary, quaternary,... constraints: the secondary constraints arise directly from the condition that the primary constraints are preserved by time, the tertiary constraints arise from the condition that the secondary ones are also preserved by time, and so on.) Primary and secondary constraints were introduced by Anderson and Bergmann (1951, p.1019) and developed by Dirac (1950, 1958, 1958b, 1964).
The terminology of primary and secondary constraints is confusingly similar to that of first and second class constraints. These divisions are independent: both first and second class constraints can be either primary or secondary, so this gives altogether four different classes of constraints.