If the algebra $A$ does not separate points on $X$ (a compact metric space), then there exist distinct points $a, b\in X$ such that $f(a)=f(b)$ for all $f\in A.$ If $A$ were dense in $C(X),$ then every $f\in C(X)$ would satisfy $f(a)=f(b).$ That's a contradiction, since $f(x) = d(x,a)$ belongs to $C(X).$
If the algebra $A$ vanishes somewhere, then the constant function $1$ is not the uniform limit of functions in $A.$