One may grind hummus or leaves lechatchilah, even though worms may be in a large amount, because the one who grinds does not intend to nullify a prohibition. As the Ran wrote, it is forbidden to nullify a prohibition lechatchilah only for one who intends to nullify it in order to benefit from it.