Because you were playing with an illegal formation. What formation were you playing?

You need 3 or more defenders and at least one player on each flank.