Looks like we have 2 arguments here:
1. The offense should stay offense for the duration of a play and the defense should stay defense for the duration of the play, thus this negates the McCardell TD being scored for TB Def.
2. Once the ball changes possession, the other team becomes the defense, thus the TD should count for Tampa's defense.
The problem with argument No. 1 is (IMO), and I think according to technical football rules, the team with possession of the ball is ALWAYS the offense. I don't believe there is a such thing as a defensive touchdown. However, if we used this theory the defensive team could never score in fantasy. So we try to create these boundaries to keep track of score for a game we made that sort of clashes with actual football rules. I think you will be hard pressed to find a hard and fast answer to this question (i.e. was it offensive or defensive), because in the real world no one cares who actually scored it. There weren't any rules created to determine whether on a given play if this or that happens, "should we consider this guy to be offensive or defensive?," because that's irrelevant to what actually matters, that the TD was legally scored.
The problem with argument No. 2 is that this doesn't make sense for fantasy football, somewhat like but hardly mentioned "intentional safety". Some would argue that the defense didn't actually score the points and some would argue that the points go somewhere and the defensive unit was on the field at the time. Likewise, some argue that the offense became the defense and some would argue that the defense should score only when the defensive unit is on the field.
In trying to mesh football rules with fantasy logic, it's created somewhat of a standoff. If this situation affected your game in a win versus loss fashion, I think the best thing to do would be for the commissioner to rule (if possible) the game a tie and establish how it will be ruled for your league in subsequent occurrances.