But A is not necessarily wrong.
I prefer the second versions of the following:
Her goal is getting a gold medal. Her goal is to get a gold medal.
John's ambition is becoming a doctor. John's ambition is to become a doctor.
You can see that a sentence like the above could be ambiguous, ie. it's not John that is becoming a doctor; it's his ambition that is becoming a doctor. (Not a good example, but I hope you see the point). This doesn't happen with the "to" version. I would advise using the "to" form unless you have a good reason not to.
Student or Learner