My pony is a rescue mare she too used to kick the stable wall and also fencing. It was because she was anxious and wanted to go out etc, eventually she learnt to wait and settled down and stopped doing it.
I would get the vet to check her out and try not to give in to her and turn her out or bring her when she kicks as you are rewarding her bad behaviour.