If I haven't misunderstood something myself:
The constraint is the same, sure, but the other is complex and the other real:
If U∈U(n), |det(U)|=1 (it preserves the norm) and det(U) is in ℂ, so it's of the form eiθ for some θ∈ℝ -- there is one free parameter "in the determinant". Further requiring U∈SU(n) means that det(U) is exactly one, so one "degree of freedom" (one free parameter) is lost and θ=0 exactly. So dim(SU(n))=dim(U(n))-1.
If O∈O(n), |det(O)|=1 still, but since det(O) is now in ℝ, there is a discrete set of two possible values instead of a free parameter: Either det(O)=1 or det(O)=-1. So, requiring O∈SO(n) just picks one of these two options, that det(O)=1, but it doesn't remove any actual free parameters, so dim(SO(n))=dim(O(n)).
(That's obviously not a proof, of course, but merely something that made me understand the reasoning behind it.)