I have read a lot of posts here about weird behaviour, does this only happen if around other snakes, or even if there is only one snake and they just know they should be doing something? sorry if thats a daft question!
It can happen regardless of whether or not you have multiple snakes or if you only have one. Sometimes they just do it, it's an instinctive thing and you can't change that.