Both are correct, but they have slightly different meanings. "A" and "The" give different meanings, as you probably know.
An advantage (=any one of many) of ... is that ...
The advantage (=the main or only one) of ... is that ...
"An" refers to any one of several - it is general and vague.
"The" refers to the main one, or the only one - it is specific.