You're confusing the "diversity lottery" by which foreigners from selected countries may apply for extra green cards (50,000, IIRC) over and above those normally granted, with the green cards given through the normal application process.
Think about it: if all green cards were given by lottery, and Mexicans were ineligible, then no Mexicans would get green cards. That's clearly not the case.