This is my 1st post, and I need some help answering a question.

I played a hand to the river and called an all in on a Ace high flush that was on the table. The community cards were as follows

10, 8, 5, K, A all Clubs

My hand was a K Diamonds, and 5 Spades

My opponent had Q Clubs, and 8 Hearts

Now I know if both players have a flush the higher suited card wins, but if we both had an Ace high Flush , why did he win the pot

Thanks