Astronomy aka. Selwyn's excuse for walking the halls at night. Frankly, he was surprised more people hadn't figured out this little ruse. You took the subject, and then, because it happened in the middle of the night, half the professors didn't know what was going on. If you got caught breaking curfew, there was always the good old "I was on my way to the Astronomy Tower" trick. Or "I thought I'd get a hot chocolate after Astronomy" trick. Or, to be honest, a million other variations of the same.
Hogwarts teachers were really gullible, when you thought about it. Maybe because they were so old. They probably couldn't even remember their childhoods anymore.
But for every good thing, there was always a downside, and Selwyn did actually have to turn up to his Astronomy lessons. It was a drag, but there it was. And because he was a perfectionist, he had to get good grades as well. Well, because he was a perfectionist and because his father would tan his hide if he didn't.