I think the age and development of the child determine whether they know why they are saying sorry though, but yeah, totally agree it's pointless if its just to say the word without any meaning or understanding not to repeat the behaviour

DS at 3yrs3m has a pretty good understanding - the other day I had a pregnancy meltdown when he refused to wear the third pair of pants offered. I just sat on his bedroom floor and burst into tears (hormonal 38w preggo over it moment), he came up to me hugged me and said "I'm sorry Mummy, I'll get dressed now" and promptly did without another protest.

So if they understand, then definitely go with it (not necessarily with the emotional hormonal Mummy tears though LOL)