Because π pairs quarks of the same flavour with their antiquarks, both up quark (+) paired with up antiquark (−) and down quark (+) paired with down antiquark (−) leave it with zero charge (like a neutron).