Health secretary Matt Hancock has been reminded that he voted against free school meals - after he praised the government for providing them.