Alternate pose. Three things. First go over your headstand technique with an instructor that you trust. A proper headstand should not have you bearing all of the weight of the body on your head. If you are using the tripod version, most of the weight should be borne on your arms. The head should actually be fairly suspended without a lot of pressure.Second, do not do headstands if this causes persistent problems.
Conservative Care. The best thing to do for a stiff neck after yoga is to stretch, ice and use some over the counter anti-inflammatory medication such as advil or aleve (naproxen). If you have continue problems with stiff neck neck after doing headstand, maybe this isn't the best idea for your neck. If this was a one time problem, then you can continue.