Is The Union of Intervals an Interval or not?
For a statement to be true in mathematics, it must always be true without exception. The statement "The union of two intervals is an interval" is false because even though, sometimes, the union of two intervals is an interval (as in your second example), there are counterexamples. Since the statement is not always true (as in your first example), we say that it is false.
The union of intervals is not always an interval. Sometimes it is, sometimes it isn't. Your second example is in fact an interval, while your first example is not.
The problem is that you and your teacher have different interpretations of an ambiguous English statement as a precise mathematical statement.
Your teacher's intended meaning.
"The union of [any two] intervals is not [necessarily] an interval". This statement is easily proved true by providing two disjoint intervals whose union is not an interval, such as [0,2] and [4,5].
In other words, there is counterexample to the false statement "For all intervals $X$ and $Y$, $X \cup Y$ is also an interval."
Your interpretation
"The union of [two particular] intervals is not [ever] an interval". This statement is easily proved false providing an example of two overlapping intervals whose union is an interval, such as (0,8) and (7,9).