It is not a sin to see someone naked, but it is a sin to look lustfully at someone (even if that person is clothed): Mat. 5:28. The potential for sin is in our attitudes to a situation: if we happen to see someone naked and are unkind to them (like Ham was to his father: Gen. 9:22-25), or if we lust after them, then that is a sin.
The Law often said that people should not ‘uncover the nakedness’ of other people, people who are not our spouse (e.g. Lev. 18:7-19). Part of what the Law is saying here is that we shouldn’t purposefully try to look at people’s nakedness for our own pleasure — that would be a sin.
If someone is naked because they are poor or in trouble then we should help clothe them (Isa.58:7) — it is not a sin to see them naked, but our response to them could be either a sin or an act of godliness.