Why do we need the axiom of pairing in Von Neumann-Godel-Bernays Set Theory?
Doesn't the following prove it?
Suppose $A$ and $B$ are sets. Using the axiom of class comprehension, we can form a class $C$ such that $$ x \in C \iff (x = A \lor x = B) $$
NBG doesn't usually (at least as developed in e.g. Mendelson, Introduction to Mathematical Logic) contain one axiom scheme of class comprehension, but a finite set of axioms that together combine to a class existence metatheorem.
However, those class existence axioms depend on the fact that we already know that ordered pairs exist for every pair of sets, and the pairing axiom is necessary for that.