It's illegal to walk around naked in public, but what if someone is literally too poor to afford clothes?
This situation is unlikely to come about in practice. If you were born into such extreme poverty, your parents would considered guilty of child neglect, and CPS/social services would take you into foster services where you would be given clothes.
If you previously had clothes, but recently became poor, it is very unlikely that any creditors would repossess your last shirt off your back. It would probably be illegal for them to leave you in that situation, and a used shirt wouldn't be worth much. For the same reason, it's unlikely you would sell your last shirt to, eg. pay for food: Who would buy it? For how much?
In many countries, there are extensive welfare systems and private charities that private food, free clothing and other resources to the very poor. Even before you lost your last clothes, you could go to these for assistance. So again you are unlikely to involuntarily end up in this position.
Also, technically the amount of clothes you are required to wear is usually very small. I believe you are usually only required to cover the groin and breasts if female. In theory you could easily collect a discarded plastic bag, piece of paper, scrap fabric, cardboard box or some other trash to fashion a crude loincloth.
Lastly, when the police do show up and arrest you, you will likely have the opportunity to explain to them your situation. They would probably try to get you some basic clothing and other assistance. But if they do end up pressing charges, you would be able to either convince the judge to let you off or challenge the law itself for failing to consider poor people like you.
Generally, laws are designed such that there is always an option to follow them and nobody would be "too poor" to comply, failing to do this could make a politician extremely unpopular. Many laws with significant cost burden offer alternatives to the poor. Courts will also tend to be sympathetic to cases such as this. But as I said, the situation is very unlikely to come about.