Shame and pity as mass (uncountable) nouns represent emotion emotion or social status.
Shame, in that sense, is what is meant when someone is ashamed. As an emotion, it is the state of knowing that you have done wrong. As a social status, it is other people knowing that you have done wrong.
Pity is similar to the everyday use of sympathy in some cases, but it carries a more negative connotation. To have pity on someone, or equivalently to pity someone, is to feel sorry for them, to recognise that their situation or experience is not good. By extension, in similar many to have mercy, have pity can mean to act to demonstrate that pity.
Similar distinctions apply to honour, which is essentially a complement to shame. To be seen as having honour is a social status recognise that you act properly, or have acted properly. It doesn't really exist as an emotion, though, except in the past tense - to feel honoured is to have been shown honour, or been given honours (official recognition like a knighthood). To have been shown or done honour is to have been treated with great respect.
As a countable1 noun, represented by the versions with indefinite articles, a pity and a shame are colloquially used as near-equivalents. The example of a pity in your question is, however, in error. That is not how it would be used. If something is a shame or a pity, as in what a shame, it indicates that an outcome is regrettable.
1: if you classify nouns only into countable/uncountable, these are countable nouns that never exist as plurals. If you classify further, then they are singular-only nouns.