Going through my notes on predicate logic, I read the following inductive definitions:
Definition: An atomic term is either a variable or a constant. If $f$ is an $n$-place function symbol and $t_1, . . . , t_n$ are terms, then $f(t_1, . . . , t_n)$ is also a term.
Definition: An atomic formula is a string of the form $P(t_1, . . . , t_n)$ for the $n$-place predicate $P$ (which may be the equal sign) and the terms $t_1, . . . , t_n$. If $F$ and $G$ are formulas, so are $$\neg F,(F ∧ G),(F ∨ G), ∃xF, ∀xF.$$
Definition: An occurrence of a variable $x$ in a formula $F$ is bound iff it is part of a subformula beginning with $∃x . . .$ or $∀x . . .$, in which the quantifier in question is said to bind the variable, and otherwise the occurrence is said to be free. A formula is a sentence iff no occurrence of any variable in it is free.
It seems to me that these definitions allow for formulas such as $$\forall x\exists x (x < x)$$ to be a sentence. If so, is that not problematic? Once semantics are introduced, the interpretation gives a truth value to every sentence, but the above formula does not seem to be of the kind deserving of a truth value.
Is it problematic to allow for expressions such as $\forall x\exists x (x < x)$ to count as well formed sentences? No (as others have explained). You can set up your formal first-order logical languages that way, while keeping everything working systematically in an acceptable way.
Is is necessary to allow for expressions such as $\forall x\exists x (x < x)$ to count as well formed sentences? Not at all. You can set up the construction rules for your first-order languages so that the things go along these lines: if $\varphi(n)$ is a sentence involving occurrences of the name/parameter $n$, but involving no occurrences of the variable $\xi$, then $\forall \xi\varphi(\xi)$ and $\exists \xi\varphi(\xi)$ are sentences. This sort of construction rule doesn't generate repeated or vacuous quantifiers.
Does it matter which way we go? Formally no. But perhaps conceptually, the second approach is to be preferred. The idea is that the key semantically-relevant unit is not a bare quantifier expression $\forall x$ but rather $\forall x \ldots x \ldots x \ldots$, the quantifier prefix plus its associated variables, which taken together make a composite expression which applied to an expression of type S/N (a perhaps complex predicate) yields an expression of type S.