Description of spin and isospin collective excitations with a nuclear energy density functional constrained by low-energy QCD