No, a programming language does not have to be compiled.
However, a proper programming language does need to be able to implement the same class of algorithms that other programming languages can; this property is called Turing completeness.
HTML and CSS are not real programming languages because they can only specify a limited class of computations; they can't describe an arbitrary loop. Because it is important that web pages can be displayed quickly and reliably, HTML and CSS have been designed so that they are guaranteed to terminate -- if they could describe an arbitrary loop, a broken or malicious web site could lock up the display engine indefinitely, as it tries to evaluate the basic HTML and CSS.
Addition: some of the comments mention that CSS3 is Turing-complete. This is arguably, technically true in the sense that you can encode a cellular automaton in it -- but, if I understand correctly, any evaluation of the CSS can only take one step of the cellular automaton.
To put it another way: the "loop" that enables CSS3 to be Turing-complete is a loop of the user reevaluating the CSS. As one answer to this question puts it: "calling non-Turing-complete code in a loop can make it Turing-complete".