While it is not essential, my own experience suggests very strongly that it would be the best thing to do. Apart from the benefits of getting to know the city and making contacts, it would be very difficult to get work here if you were living in another country.
I did the TEFL course here 3 years ago and realised immediately that I needed to be here if I was going to get work. Most employers here will not give newly qualified English teachers a full-time position, even if they have other teaching or relevant experience. The normal way things happen is that you will be employed on a contract basis for each group, which could be as little as 3-5 hours teaching a week. More classes and contracts are then made available as they come along and depending on whether the employer feels you are a good teacher. How they determine that is a mystery to most of us!
So you can expect to have to look for a number of different employers at first, perhaps doing a number of contracts to build up your hours. Employers always expect immediate availability as well, so you would need to be able to have an interview on the same day and perhaps start teaching the group the next day. A bit difficult if you are not living here.
There are also administrative things which you will need to do before you can be employed here, such as opening a Spanish bank account, registering with Social Security and obtaining a NIE (identification number for non-Spanish nationals). These take time - and a lot of patience. Without these you would only be able to teach private students - illegally. None of us do that of course. Finding affordable and decent accommodation here is also hard work.
Finally, and I hope I am not putting you off, there is a lot of competition here for English teaching work, so do not expect to get rich! I came here with a little capital to keep me going as I got into the job market, and I needed it. I have seen so many new English teachers, many young, who came with little cash and hoped for the best. The majority had to give up.
So, be here and with some cash. All in all it is worth it. I love this crazy city and teaching English here.
Send me a private message if I can help further.