Immigration laws offer harsh punishments for individuals who do not cross the border lawfully. With rare exception a person who enters this country without inspection at a port of entry cannot receive a lawful status without returning to their home country to process the paperwork and often leaving the United States triggers a 3 or 10 year bar from them returning.
This could be argued as a just punishment for individuals who usurp our immigration laws and cross our border illegally. Clearly it would an injustice to the millions of individuals who apply lawfully, pay filing fees, and wait a number of years if illegal entrants were rewarded for their behavior with a legal status. Thus, in most cases the law is arguably just.