On its face, the policy sounds silly. But there's a reason for it -- including the fact that close to 1/3 of the school's students were concerned about public displays of affection (PDA) in the school halls.
When I was writing Prude, I learned that in junior high schools all over the country, there are PDA's going on that are clearly inappropriate in an academic setting (and in some cases, inappropriate anywhere, given the tender age of the participants). The behavior only contributes to a highly-sexualized atmosphere -- one in which boys are actually willing to approach girls they know only casually and graphically solicit sex.
Apparently, parents are "split" over the merits of the 2-second hug policy, and that's part of the problem. Such a policy is, sadly, necessary in the first place because young people aren't being taught -- no doubt by some of the parents opposing the policy -- about what constitutes acceptable behavior. As a result, hard-and-fast rules have to be put into place, and everyone's freedom is formally constrained as a result.
In a sense, the whole episode is a perfect example of what happens when informal social sanctions against inappropriate sexual behaviors are eroded. Simply to keep order and enforce some standards of behavior, the "government" (in this case, school authorities) have to get involved and make hard-and-fast laws (in this case, rules) that end up imposing one more layer of top-down control over people's behavior.
The policy is probably necessary -- but that's a shame, isn't it?