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.)

Thank you, I had just gotten to a similar conclusion myself. Also, I thought about it topologically: in the orthogonal case, O(n) is formed of two disjoint sets, (i) detR=1 and (ii) detR=-1, of which only one is a subgroup {i.e. SO(n), with detR=1, as it contains the identity}. Therefore removing the bit (ii) detR=-1 doesn't "get rid" of any subgroup, but only of a coset in O(n). In U(n) nothing of this happens, as it is compact and connected (which I think reflects on the fact that we have a continuous set of possible values, as opposed to the discrete one in O(n)).

I don't enough topology or group theory to be sure about this, but this is the way I thought about it. Can somebody tell me if I'm wrong?

It seems right to me. ##U(n)## is a connected ##n^2 - 1##-dimensional manifold, you can always create a coordinate system where one of the coordinates is ##\theta## the logarithm of the determinant. Hence, ##SU(n)## is simply the ##\theta = 0## submanifold, and so has one dimension less.

In the ##O(n)## case we simply have two manifolds of the same dimension, one indexed with ##+1## and the other indexed with ##-1##. ##SO(n)## is simply one of these manifolds.