Reaction of amines with diethyl oxalate (Hofmann amine separation method)
When a 1° amine attacks to a carboxyl group, The structure below (left) is generated which lowers the energy level of the intermediate such that the second amine can easily react with the other carboxyl group.
It is clear that 2° amines (right) don't have such proton for hydrogen bonding with the oxygen. Why the second 2° amine doesn't attack to the other carboxyl at all is maybe due to the decreased partial positive charge of the amide (less electronegativity of nitrogen) toward the carboxyl.
Finally, 3° amines don't have even a leaving proton to substitute with the ethoxide.