Pity here is used as a countable noun meaning something regrettable, so it needs an indefinite article. The word begins with the consonant sound p, so the article is a, not an. Using the would make the sentence refer to a specific pity, which does not fit the idiom. Hence a is correct.