I think that what you’re missing is that an open cover of a compact set can cover more than just that set. Let $X$ be a topological space, and let $K$ be a compact subset of $X$. A family $\mathscr{U}$ of open subsets of $X$ is an open cover of $K$ if $K\subseteq\bigcup\mathscr{U}$; it’s not required that $K=\bigcup\mathscr{U}$. You’re right that $\bigcup\mathscr{U}$, being a union of open sets, must be open in $X$, but it needn’t be equal to $K$.
For example, suppose that $X=\Bbb R$ and $K=[0,3]$; the family $\{(-1,2),(1,4)\}$ is an open cover of $[0,3]$: it’s a family of open sets, and $[0,3]\subseteq(-1,2)\cup(1,4)=(-1,4)$. And yes, $(-1,4)$ is certainly open in $\Bbb R$, but $[0,3]$ is not.
Note, by the way, that it’s not actually true that a compact subset of an arbitrary topological space is closed. For example, let $\tau$ be the cofinite topology on $\Bbb Z$: the open sets are $\varnothing$ and the sets whose complements in $\Bbb Z$ are finite. It’s a straightforward exercise to show that every subset of $\Bbb Z$ is compact in this topology, but the only closed sets are the finite ones and $\Bbb Z$ itself. Thus, for example, $\Bbb Z^+$ is a compact subset that isn’t closed.
It is true, however, that compact sets in Hausdorff spaces are closed, though a bit of work is required to establish the result.
Let $p$ be a limit point of the set $Y$ that is not contained in $Y$. Then $(U_n)_{n\in\mathbb{Z}^+}$ with
$$U_n := \{ y \in Y : \lvert y - p\rvert > \frac1n\}$$
forms an open cover of $Y$ which has no finite subcover.
Best Answer
Consider any open cover $G_{\lambda}$ of $T$. Then if $S \subseteq G_{\lambda}$ too there is a finite covering of $S$ using sets from $G_{\lambda}$ which also contains $T$ and hence is a finite covering of $T$. Suppose $S \not \subseteq G_{\lambda}$. Then consider $ G_{\lambda} \cup T^C $ which is an open covering of $S$ since $T$ is closed and $T^C$ is an open set. Then again since $S$ is compact we have that there is a finite covering of $S$ using sets in $G_{\lambda} \cup T^C $. Removing $T^C$ if it was part of this finite covering we have a finite covering of $T$. Hence $T$ is compact.