Snideness aside, your argument is that laws ought not apply to someone who is poor.
That's sometimes reasonable - e.g. the apocryphal loaf of bread being stolen to feed a starving family. But it's not a universal defence. And not all illegals are poor in the first place.
If a law can only possibly impact the poor, then that law is effectively written to impact the poor - the purpose of a law is what it does.
If you make it illegal to sleep on the street at night (by extension, sleeping anywhere that isn’t a legal residence), you are de facto making it illegal to be homeless.
That a law applies to everyone is not a “universal defence” in its fairness.