I mean it depends on what you want to do. If you want to be an orthopedic surgeon you are going to most likely need research. If you want to do something that is less completive like family medicine or pediatrics research is less important. I will say as a caveat that if your goal is to do something like peds at CHOP or IM at Hopkins then research would probably better as high ranked programs are super completive no matter what specialty.
I would encourage everyone to do some kind of research/scholarly activity during their time in med school as you will eventually have to do this during residency and potentially as an attending, but if you really hate it or you're more passionate about something else and you may never have the opportunity again I say go for the alternate activity. Maybe you will learn something about yourself or gain greater insight on the subject matter that will help you elsewhere in your career. Research will always be available and one of the nice things about it is that if you find the right PI they may even let you work on it in your free time and not during normal business hours.
Also I disagree with the above poster that doing research without pubs looks bad. Research by nature is a lot of trial and error with modifications. Now if you worked in the same lab for 40 hours a week for 4 years and never even made a poster that might be a little concerning. The main thing to take away from research is the process and being able to verbalize what you did, why you did it, and where it may go in the future. On the other side lets say you walk into an interview and someone asks you to talk about your 10 manuscript publications. If you can't really talk much about them or the process of how they were created that's a little bit of a red flag because it shows that you did not actually learn anything and you took more of a passive role, rather than an active one.
Long story short: Good Research looks better than TA in general, but don't choose it if you hate doing research or you really want to do the TA position for some other reason.