Going
Deeper
Singly vs Doubly Occupied Orbitals

Why is it better (more stable) to have an occupation like 2px(↑)2py(↑) than 2px(↑↓)?

Although the Pauli principle tells us an orbital can tolerate two electrons with opposite spins, electrons in different orbitals interact less repulsively than electrons in the same orbital.