Because "a" is an indefinite (not specific) article and "the" is a definite (specific) article.
For example:
I'd like an apple (not specific, any apple will do)
Can you give me the apple (talking about an apple in sight)
Same with "a first time". The time is not specified, you don't know when the "first time for everything" will be, you only know that there will be "a time" at some point.