How to incorporate a symmetry constraint in the loss function to train a CNN?
If you know it is symmetric, then you could do a couple things.

Zero out a half.

Don't bother learning both halves of the image. Just put a zero mask over the upper or lower half of the output matrix and just have the network regress the other half. Just don't make the network do more work than it needs to do.

Learn both, but add symmetric loss

In your case, it looks like you could create two loss functions added together.
$focal(x, y) + focal(x^T, y)$
This will help the network learn both halves equally.

L1 between $x$ and $x^T$

This might be silly but adding a Huber loss between $x$ and $x^T$ might help promote symmetry, but I'm not as much if a fan of it. Personally I'm more partial to (1).

Combine (1) and (2)

You could take the loss function of (2) at train time but at test time just use whatever half had better metrics and copy that to the bottom half.

Post Processing

Add a post processing custom layer that takes the average of the two halves so that you guarantee symmetry.
$x' = \frac{1}{2}(x + x^T)$
Then do your normal focal loss. Personally I like this the best since it always guarantees a symmetric output and is a pretty easy custom layer.