You make an excellent point. Our country is very unique in that we do not have a national police force. Mexico has the federales for example. We have the border control and ICE...fairly small national law enforcement agencies.
State and local police are not hired to enforce immigration law...although in days gone by there was usually willing cooperation between states and feds. The bottom line is local governments have no legal obligation to turn illegal immigrants over to the feds.
But....to interact with any government agency, people need to have a legal status which can only be obtained through the federal government. This means having a social security number or a passport or a work visa etc. States and local governments often ignore the fact that when letting people into schools, colleges, welfare programs etc. California issues drivers license to people who aren’t citizens as well.
This is where the leverage lies for those of us people who simply want our laws followed. Any agency, public or private, that employs are assist an illegal immigrant (in the case of benefits) without a legal status can be subject to harsh penalties from the federal government because they are in fact helping a criminal break our immigration laws.
I'd be curious to know how many illegal aliens have taken advantage of this in California, because it actually works against illegal aliens in some ways. For one thing, the license you get as an illegal alien is not the same as the one you get as a U.S. citizen or legal immigrant. So anyone who sees the license is going to know right away that the person is in the country illegally.
I'm also not sure the licensing of an illegal alien is all that relevant here. I suspect most states don't have any mechanism to enforce this sort of thing anyway. For example, if I am here in the U.S. on a one-year visa and then the visa expires but I stay here, what mechanism does a state like California have to cancel my driver's license?