Yeah, pretty obvious why there are rules against campaign footage at the gravesites.
Ironically Trump could probably have got far more credit by being a bit more subtle.
The two families of the these specific soldiers genuinely wanted him at the gravesite and I don’t think anyone would have begrudged them the right to invite him to a private ceremony to mark their loss.
And therefore don’t think it would have been an obvious breach of federal law, and a case of plausible deniability, if some of their “personal” photos/video “organically” got distributed to a wider audience as long as the campaign itself didn’t have their banner on it - “Trump privately grieves with fallen hero’s family”.