1) Has this happened to anyone else? Is this a relatively common occurrence, or am I just sloppy?
It is not very common (the usual preventive techniques include showing the draft to a few experts/friends, putting it on ArXiV, letting it lie for a month or two and then rereading it, etc. before sending it to a "top" journal) but it happens now and then. What is common is severe difficulty with finding an error in one's own work. I would say that affects more than a half of mathematicians I know. The reason is that you read not what is written but rather what you believe should be there when you just finish typing the manuscript and start proofreading. The main trick of good proofreading is to turn yourself into a complete idiot, who doesn't see a single step ahead, has no idea of the overall structure of the argument, takes everything literally, and is not convinced of anything that is not clearly put in a modus ponens form. Needless to say, it is about as hard for a shrewd person to read like that as for a genuinely stupid one to read between (or over) the lines. And even if you know all that, you are still destined to submit or even publish papers with errors. Just a few months ago, I was informed about an error in one of mine published papers. It was just a remark and the statement was actually correct, but the proof wasn't. So, to have this kind of public shame now and then is almost inevitable whether you are an unknown postdoc, or Andrew Wiles, or something in between.
I'm not sure if Poincare published a single formally correct proof in his lifetime and people still are completely puzzled by some passages in Linnik's works, so you are in a good company.
2) The anonymous referee is probably someone distinguished in my field. Do they now have a bad impression of me? (This probably is not a question that can easily be answered . . . .)
It is actually easy to answer: most likely, for him you are nobody, your name is just a random combination of letters, and your "initial value" is zero. An erratic paper leaves it this way, so nothing is lost. We are all getting worthless papers to referee every month and I challenge everyone to recall the name of the author of some bad paper he rejected 6 months ago. The only scenario in which "someone distinguished" would bother to take a mental record of your name after looking at a single opus of yours is when he finds something interesting and unusual in your work. Then your value for him is currently positive, though, of course, not as high as it would be if you solved the problem. So, again, there is absolutely nothing to worry about.
3) If I manage to patch up this paper, is it reasonable to resubmit it to this journal, or have I burned my bridges there?
Of course, it is. What matters is not how many mistakes you made on the road and who saw them but whether you finally reached your destination and whether other people consider that destination worth reaching. The theorem and its correct proof lose nothing in value if somebody published or tried to publish 20 false proofs before that. That some of those false proofs might be proposed by a person with the same name and biometrical characteristics as those of the one who finally found a correct proof changes nothing in the grand scheme of events. So, if you manage to fix the error and make sure that the argument is, indeed, correct, I see absolutely nothing wrong with submitting it again because from a purely logical standpoint, it is a different paper. If you get it returned solely on the grounds that the previous version was incorrect and not based on the merit considerations (even correct and good papers get rejected sometimes for various reasons), it'll merely tell you that the jornal is not really "top" but just "snobbish", in which case I would avoid it altogether in the future (at least, until they change the editorial board).