I am not a military expert, but my understanding is that retired members of the military (in the UK, at least) do not, generally, wear uniforms to events. A Google search was inconclusive, basically what I found said it’s not forbidden, but it’s not generally done. So as Harry is not actively serving, and does not hold any honorary appointments at this time, it would not have been considered “appropriate” for him to be in uniform at the funeral (he would not have been the only one, Peter Philips and the Earl of Snowdon both walked in the procession and they have no military background). But there was some talk that it would be a shame for the only grandson who has actually seen active service to not wear a uniform when others who have “only” honorary appointments would be. I think a huge part of the strife between Harry and his family boils down to the Queen, Charles, and William saying “this is how it’s always done” and Harry saying either “But I don’t wanna do it that way” or “but do we have to do it that way just because we always have?” Should Harry have been allowed to wear a uniform even though it’s technically not the “done thing”? I could argue it either way, honestly.
And there was also talk about Andrew wanting to wear a uniform he hasn’t actually “earned” yet (he was supposed to be promoted but that was deferred when he stepped back from public view … because, you know, he’s a sex offender). It seems the Queen said “screw it, none of you wear one” (I’m probably not quoting her directly). I’m not sure I blame her.