It is a sensible combination to me. If you first believe that the government should provide a bunch of free stuff, but it doesn't at the moment because it's too expensive, it kind of makes sense that you would then think there need to be fewer people getting the free stuff so it remains affordable. The first people on the exclusion list would naturally be noncitizens.
You could, but in practice illegals get/use a lot of public goods that cannot be reasonably gated. The "means testing costs more than just giving welfare" argument is cited. Plus things like public schools, parks, transportation don't require ID to use. Having an ID is not guaranteed, as voting advocates often point out.