No, $S$ does not have to span $C(X)$.

Taking the case with $X=[0,1]$, let $\mu$ be any atomless finite signed measure whose positive and negative parts $\mu^+$,$\mu^-$ have full support, so that $\mu^+(U) > 0$ and $\mu^-(U) > 0$ for any nonempty open $U$. Then, the set $S=\{f\in C(X)\colon\int f\,d\mu=0\}$ satisfies your properties, is closed in $C(X)$, but is not all of $C(X)$.

To see that $S$ satisfies your properties, consider any $a\in U$ for $U$ an open subset of $X$. Then choose $r > 0$ such that $V=U\setminus \bar B_r(a)$ is nonempty. There exists a nonnegative $g\in C(X)$ with support in $V$ such that $\mu(g) > 0$. Otherwise we would have $\mu^+(S)\le\mu^-(S)$ for all Borel $S\subseteq V$, which would imply that $\mu^+(V)=0$ contradicting the assumption that $\mu^+$ has full support. Similarly, there is a nonnegative $h\in C(X)$ with support in $V$ and $\mu(h) < 0$. By scaling, we can assume that $g,h$ are bounded by $1$.

Now, the functions $f_n(x)=\max(1-n\vert x-a\vert,0)$ have support in $B_r(a)$ (for $n > 1/r$) and decrease to $1_{\{x=a\}}$ as $n\to\infty$. As $\mu$ is atomless, we have $\mu(f_n)\to0$. Choosing $n$ large enough that $\mu(h) < \mu(f_n) < \mu(g)$ then $f=f_n+\lambda h$ or $f=f_n+\lambda g$ will satisfy $\mu(f)=0$ for some $0\le\lambda\le1$. But, $f\in S$ satisfies (i) $0\le f\le1$, (ii) $f(a)=1$, and (iii) $f=0$ outside of $U$.

As such measures $\mu$ will always exist on any compact metric space without isolated points, your conclusion does not hold on *any* compact metric space other than when $X$ is countable.