Green cards and illegal immigration aren't one and the same though. People who crossed the border illegally were doing so for a myriad of reasons, some of which includes gaining employment and for others it is/was an opportunity to exploit the financial safety net hence the term "anchor baby."
Either way, granting citizenship isn't about preventing illegal border crossing, it's more so about identifying those who are already here and making a "humane" effort to work with them. OTH, some people are against that because they believe that it "rewards" bad behavior, and to some extent encourages more people to cross illegally. Both have a point to it IMO, and I'm pretty conservative. Do you send people back and break up families? Do you grant them citizenship, thereby "rewarding" them for their actions and unintentionally invite more illegal crossings? I don't know.
I personally am against granting citizenship on the legal principle of not only because I think that it rewards bad behavior, but because I have friends who are immigrants who have come here legally...and they are struggling through the process to become legal citizens. Many of them have worked here legally as immigrants and have formally educated themselves and they have no one looking out for them.