Minimizing the number of non-zero columns in $D$ is equivalent to maximizing its zero-columns. Due to the way matrix multiplication works, the $n$th column of $B_{1}X_{1}$ depends only on the $n$th column of $X_{1}$.
So, denoting $M_{[n]}$ to be the $n$th column vector the matrix $M$, we can split the problem into $n$ independent sub-problems, one for each column of $D$:
$$\vec{D_{[c]}} = \vec{A_{[c]}}+B_1\vec{X_{1[c]}}+B_2\vec{X_{2[c]}}\\ c\in \{1\dots n\} $$
Now the aim is to see how many of the column vectors of $D$, that is , how many $\vec{D_{[c]}}$, can be set to $0$.
The equation has solutions if and only if $A_{[c]}$ is situated in the subspace-sum of the image of $B_{1}$ and the image of $B_{2}$. Ie $\vec{A_{[c]}}\in (Im[B_1] + Im[B_2])$.
Once this is checked for all columns of $A$, the maximum can be know.
More concretely, $B_{1}$. $B_{2}$ and $A$ can be considered as being "made up" of column vectors. A given column vector of $A$ can be made zero if and only if it is not linearly independent of the set made of the column vectors of $B_{1}$ and $B_{2}$. The minimum number of non-zero columns of $D$ is the number of columns of $A$ that are linearly independent with respect to that set.