  Induced by the Hagedorn instability, weakly-coupled $U(N)$ gauge theories on
a compact manifold exhibit a confinement/deconfinement phase transition in the
large-$N$ limit. Recently we discover that the thermal entropy of a free theory
on $\mathbb{S}^3$ gets reduced by a universal constant term, $-N^2/4$, compared
to that from completely deconfined colored states. This entropy deficit is due
to the persistence of Gauss's law, and actually independent of the shape of the
manifold. In this paper we show that this universal term can be identified as
the topological entangle entropy both in the corresponding $4+1 D$ bulk theory
and the dimensionally reduced theory. First, entanglement entropy in the bulk
theory contains the so-called "particle" contribution on the entangling
surface, which naturally gives rise to an area-law term. The topological term
results from the Gauss's constraint of these surface states. Secondly, the
high-temperature limit also defines a dimensionally reduced theory. We
calculate the geometric entropy in the reduced theory explicitly, and find that
it is given by the same constant term after subtracting the leading term of
${\mathcal O}(\beta^{-1})$. The two procedures are then applied to the
confining phase, by extending the temperature to the complex plane.
Generalizing the recently proposed $2D$ modular description to an arbitrary
matter content, we show the leading local term is missing and no topological
term could be definitely isolated. For the special case of ${\mathcal N}=4$
super Yang-Mills theory, the results obtained here are compared with that at
strong coupling from the holographic derivation.
