All the parents I know do this out of choice, so many schools now specify that cycling/pe shorts may be worn under summer uniform dresses as long as the hem isn't lower than the skirt.
DD (12) still can't do handstands successfully, let alone cartwheels, but she was smart enough to realise that dresses were (a) bloody uncomfortable when they all had to sit on the floor and (b) useless for playing in, especially on the "bars" (c) had a tendency to lift up unexpectedly in the wind, sending the boys into fits of giggles about knickers.
I did buy her a couple of summer dresses in year R but she didn't like them and has always worn trousers ever since - for her they're more comfortable and practical.
It sounds to me as if the teacher was being kind. Your DD was probably the only one not wearing shorts under her dress.