Why is there complementary base pairing for DNA?
It's to do with the physical space the base molecules occupy. There are 2 classes of molecules in DNA bases, purines and pyramidines.  One of each always pair together as there will be a total of 3 ring moieties present.

E.g., Adenine (a purine) pairs with Thymine (a pyrimidine).



If you were to pair 2 pyrimidenes together, you would induce a kink in the DNA backbone and destabilise it.

That said, there is no chemical reason 2 purines or 2 pyrimidines can't hydrogen bond, and they do. This causes mismatches and DNA mismatch repair enzymes recognise the torsion it induces in the DNA backbone and they replace the mismatched base in the proofreading process. If the enzymes miss one mispairing, which can happen as it occurrs often (but the enzymes are very effective), then you end up with a mutation.