New Mexico has enacted legislation prohibiting armed federal law enforcement agents from attending polling places during state elections.