No such ideal exists.
A simple Lie algebra $\mathfrak{g}$ over a field $k$ is called absolutely simple if for every algebraic extension $K\vert k$ (or equivalently: for an algebraic closure $K\vert k$) , the scalar extension $K\otimes \mathfrak{g}$ is also simple (note that it necessarily is semisimple; for an example where it is not simple, see below).
One can show that if a Lie algebra over a field $k$ is simple but not absolutely simple, it is the scalar restriction of an absolutely simple Lie algebra over some algebraic extension $K \vert k$. Actually, one can compute $K$ as the (associative) subalgebra of $End_k(\mathfrak{g})$ consisting of those elements that commute with all $ad_\mathfrak{g}(x), x \in \mathfrak{g}$. As far as I know, this was first shown by Jacobson in Duke Math. J., Volume 3, Number 3 (1937), 544-548, doi:10.1215/S0012-7094-37-00343-0, and holds for more general kinds of algebras. I wrote a little overview of that in section 4.1 of my thesis, a lot of it is now reproduced in this answer of mine.
Now to your question: Since scalar extension commutes with direct sums, and ideals of semisimple Lie algebras are direct summands, your question is equivalent to asking whether there exists a simple compact real Lie algebra $\mathfrak{g}$ which is not absolutely simple. But by the above theory, and the fact that the only proper algebraic extension of $\Bbb R$ is $\Bbb C$, the only simple but not absolutely simple real Lie algebras are: the simple complex Lie algebras considered as $\Bbb R$-algebras. The first example maybe being $\mathfrak{sl}_2(\Bbb C)$ viewed as a Lie algebra over $\Bbb R$ (six-dimensional); it is simple, but not absolutely simple, as its scalar extension $\Bbb C \otimes_{\Bbb R} \mathfrak{sl}_2(\Bbb C)$ actually is isomorphic to the sum of two copies of $\mathfrak{sl}_2(\Bbb C)$.
However, none of these scalar restrictions of simple complex Lie algebras correspond to compact Lie groups, e.g. because they obviously contain nilpotent elements.