Wa alaykum salam,
mad_scientist, why would you feel the need to contemplate it? Can you not just assume that it is purely a test and leave it at that? A test for the person with the illness and also a test for those around him.
Also, remember Ayub Alaihe Salam was severely tested with illness that was visually unappealing too. We wouldn't say it was out of punishment.
Edit: You might be talking specifically about those people that have gotten AIDS due to zina, in which case you might be right that it might be a punishment. However, as part of husn al dhan, it's better not to delve too much into it and assume they are the worst people or anything of the sort.