Since $N$, the number of students, is even, let's call it $2M$.
The formula you quote can be obtained using the following reasoning. First let us divide the set of people not into pairs, but into pairs with designated leader, who gets to wear a special leader shirt.
We can choose the set of leaders in $\dbinom{2M}{M}$ ways. Now assign a follower to each leader. This can be done in $M!$ ways.
So the number of pairings with designated leader is $\dbinom{2M}{M}M!$, which simplifies to $\dfrac{(2M)!}{M!}$.
But if we want to divide into plain groups of two, we have overcounted by a factor of $2^M$. For if $D$ is the number of democratic groups of $2$, then the number of groups-with-leader is $2^MD$. This is because for any division into democratic groups, there are $2^M$ ways to choose the persons in the democratic division who will wear the leader shirts. Thus
$$2^M D=\frac{(2M)!}{M!},$$
and now solving for $D$ we have our count.
Remark: The following is another way to count the number of divisions into groups, this time directly. Line up the students in order of student number, or weight, or beauty.
For concreteness, assume there are $12$ people in the group. The first student in the list can select her partner in $11$ ways. For each such way, the first still unpartnered person in the lineup can select her partner in $9$ ways. Once this has been done, the first unpartnered person in the list can select her partner in $7$ ways. And so on. So the number of divisions into groups is
$$(11)(9)(7)(5)(3)(1).$$
To get back to the formula of the OP, multiply top and bottom by the "missing" numbers, so by $(12)(10)(8)(6)(4)(2)$. On top, we get $12!$.
At the bottom, we get $(12)(10)(8)(6)(4)(2)$. Taking out the $2$'s, we get $(2^6)(6!)$.
The same idea works in general. The number of groups of $2$ when there are $2M$ students is $(2M-1)(2M-3)(2M-5)\cdots(5)(3)(1)$.