Loitering laws have existed since english commonlaw, but in the modern era were adapted to penalize homelessness, unemployment, etc...