I agree with ignoring them. Because all they want is treats or attention and scolding is still giving them attention! They’ll realise eventually!
personally wouldn't punish them for kicking the door i think they (as lian said) want something (food treats etc.) so just ignore them and don't award them or give them anything when they kick.
You can get a kick box that screws into the outside of the door when they kick they get sprayed with water.
With my horses if they are wanting something and kicking the door then we just don’t give it to them and ignore them over time they learnt that kicking the door gets them nothing this has worked with all my horses and ponies
Hope this helps