Yes it has been illegal to be poor, in the UK this is considered to have started in Tudor times and into Victorian. Vagrancy/begging was originally punished by whippings, stocks, enslavement but later was restricted more to imprisonment/fines. Even now some local authorities use civil injunctions and Public Spaces Protection Orders (PSPOs) to fine or penalize individuals for begging and sleeping rough. And obviously plenty of other countries have had laws and do even now.
As for what is direct or indirect and what that means. It may not be obvious that someone is poor, or even that someone is disabled, but it may equally not be obvious that someone is gay. I suppose it's considered a more singular identity to be gay and the others have a lot more variety? Even that is probably questionable actually. I think the main point is they have a group protecting their rights better than many others have.