Like a backfire? Could have just been that the engine hadn't 'spooled down' yet or that you had just a tiny feather of throttle open with your hand on the grip, and so the engine was running above idle when you shut it off. I'm sure it didn't hurt anything, just a little backfire from unburned fuel.
There are two schools of thoughts here. One is that the bike should be shut off with the key always, because the habit of using the killswitch can lead to a dead battery, if you use the killswitch but forget to turn off the key.
The other thought is, that if you use the killswitch always, you'll develop a habit that can give you quick reflexes should, in an emergency, you'd ever need to use the killswitch. This is presently what the MSF teaches.
I think both schools of thought are valid. Some have said 'Use the kill switch only in emergencies so you don't wear it out', but I don't buy it. It's highly unlikely that you'll 'wear out' the killswitch with use. It won't hurt anything to do EITHER.
I personally use the kill switch. The reason is, it's awkward for me to reach down where the key is on the 900 (like most Vulcans it's up against my thigh!). So I prefer to hit the kill switch, get off, then turn the key off and remove it. Knock on wood, but I've never ever left the key on on my bike. I also live in an apartment complex and, with loud pipes, I don't like to disturb people at night. So coming down the hill into the parking lot I hit the kill switch, then coast into my spot. Would be hard to shut the key off rolling, plus, then I'd lose my headlight!
One suggestion; don't shut it off as you roll to a stop or immediately after stopping (when I shut mine off on the hill as described, I pull the clutch in and wait a second for the engine to return to idle before doing so). You might also try developing a habit of taking your hand off the grip and shutting the bike off with your index finger, which will prevent the possibility that as you grip the handlebar to hit the switch, you're cracking the throttle open. I don't think there is any set 'time' to wait to shut down a naturally aspirated engine (on an engine with a turbocharger it can sometimes be a good idea to let it idle for a few seconds before shutting it down, but that's not the case here!). Just make sure the engine has completely returned to idle, and the throttle is completely released. If at all possible, the engine shouldn't be shut down above idle speed.
Finally, you could just switch to using the key, but if you leave the bike in gear when you stop (like on a hill or something) that could certainly be a pain in the behind!