An array in an equation with curly braces in both sides

As @siracusa has already pointed out in a comment, the \all directive should be removed. The only other significant change I recommend making to your code is adding & alignment points inside the aligned environment. (After all, why employ an algin environment if no alignment is performed?)

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'aligned' environment
\begin{document}

\begin{equation}
\delta(x)\equiv
\left\{
\begin{aligned}
0,     \quad&\text{if $x\ne 0$}\\
\infty,\quad&\text{if $x=0$}
\end{aligned}
\right\}\,,
\qquad\text{with }
\int_{-\infty}^{+\infty}\! \delta(x)\,dx=1.
\end{equation}   
\end{document}

You can use cases to simplify it a little bit and, of course, remove \all as @siracusa said.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}
\delta(x)\equiv\left.\begin{cases}
0,      & \text{if } x \ne 0 \\
\infty, & \text{if } x = 0 
\end{cases}\right\}, \quad\text{with } \int_{-\infty}^{+\infty}\delta(x)\; dx = 1.
\end{equation}

\end{document}

enter image description here


You can compare four ways to get the result.

The alignment with the original code happens essentially by chance and needs visual formatting (additions of \quad and \;).

With Bmatrix the alignment is again by chance (the second column items have the same width).

With cases, adding \left. and \right., a bigger space after \equiv is used.

The best, in my opinion, is to use \left\{ and \right\}, with a nested aligned so you can clearly state the desired left alignment of both columns.

In any case, it should be \text{if $x=0$}, so no awkward explicit \; is needed (which is not a normal interword space). Also \, should precede dx, not \;.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\subsubsection*{Original without \texttt{\string\all}}
\begin{equation}
\delta(x)\equiv\left\{\begin{aligned}
0,\quad
\text{if}\;x\ne 0\\
\infty,\quad
\text{if}\; x=0
\end{aligned}\right\}\quad
\text{with}\quad\int_{-\infty}^{+\infty}\delta(x)\;dx=1.
\end{equation}  

\subsubsection*{With \texttt{Bmatrix}}
\begin{equation}
\delta(x)\equiv
\begin{Bmatrix}
0,      & \text{if $x\ne 0$} \\
\infty, & \text{if $x=0$}
\end{Bmatrix}
\quad\text{with}\quad
\int_{-\infty}^{+\infty}\delta(x)\,dx=1.
\end{equation}

\subsubsection*{With \texttt{cases}}
\begin{equation}
\delta(x)\equiv
\left.
\begin{cases}
0,      & \text{if $x\ne 0$} \\
\infty, & \text{if $x=0$}
\end{cases}\right\}
\quad\text{with}\quad
\int_{-\infty}^{+\infty}\delta(x)\,dx=1.
\end{equation}

\subsubsection*{With \texttt{aligned}}
\begin{equation}
\delta(x)\equiv
\left\{
\begin{aligned}
&0,      && \text{if $x\ne 0$} \\
&\infty, && \text{if $x=0$}
\end{aligned}
\right\}
\quad\text{with}\quad
\int_{-\infty}^{+\infty}\delta(x)\,dx=1.
\end{equation}

\end{document}

enter image description here