Take any field $F$ and consider the ring $R=F^3$. It has three maximal ideals, corresponding to sets of elements where are zero on some fixed coordinate. Let's call them $I_1, I_2,I_3$ depending on if they contain elements that are zero on coordinate 1,2,3 respectively. Clearly all three consist of zero divisors. $I_1\cap I_2\neq \{0\}$ since it is the set of elements zero on both coordinates 1 and 2 (but they are nonzero on 3, often.)
Now every element of $I_1\cup I_2$ is zero on either coordinate 1 or coordinate 2. But there are elements of $I_3$ (necessarily zero divisors) which do not satisfy this. Thus $I_1\cup I_2\neq ZD(R)$.
In fact, $ZD(R)=I_1\cup I_2\cup I_3$. In any commutative Artinian ring, the zero divisors are the union of all the maximal ideals.
As for the title question/second part of your question about the zero divisors being an ideal, this is only the case in a commutative Artinian ring has exactly 1 maximal ideal.