According to Hirsch Goldberg in "Just Because They're Jewish," Shakespeare borrowed the story line (of the young lovers persecuted by an evil moneylender) from an ancient Roman text. In the original version, the young lovers were pagan, and Shylock was--you guessed it--a Christian.
Updating the play for his Christian audiences, Shakespeare naturally "did the right thing" and turned the lovers into Christians and made Shylock a Jew--probably because there weren't any Jews around to complain about defamation of character, having been expelled from England in the 13th Century.

