Good question, I have wondered that myself I think it's to assist with locating breadowns and accidents etc. (in some remote areas prone to poor road conditions)
The A9 and the line it takes now from Perth to Inverness is fairly unique in it was a long distance route built pretty much as one plan with all new laybys planned into the route and I guess someone had the good idea to number them.
I think the numbers stop at the Cromarty bridge or they used to.
Be good to hear if anyone has more info or different info on the reason for them