Well the villain didn't jam, the hero did. That's -
equity a huge majority of the time. His hand has showdown value, and that is what should have been done.
He either 1) wins the pot with his A flush at showdown, 2) wins the pot by raising all in and forcing the K flush to fold, 3) wins the pot by raising all in and getting called by K or 4) loses his stack by raising and getting called by a boat.
Options 1 and 2 lead to the same pot won. Option 3 is not very likely to receive a call, so reverts to option 2 (on top of the fact that the SB range would be wide, and includes a lot more low cards, so probably having a flush as good as K is out of the question). Option 4 results in a larger loss. There is really only one good option, unless you consider folding the A flush, but I think a call is justified.