"Allah only forbids you from those who fought you in religion and drove you out of your homes and supported [others] in driving you out"—as were the polytheists of Mecca, for some of them strove to expel the believers and some of them aided those who expelled them—"that you take them as allies."
This is an appositive [badal] for the relative pronoun [al-mawsul], and it is also an appositive of inclusion [badal ishtimal]. That is, Allah—Glorified is He—only forbids you from taking them as allies.
"And whoever takes them as allies, then it is those who are the wrongdoers."
They are the wrongdoers because they have placed allegiance where enmity should be, or they are the wrongdoers to their own souls by exposing them to punishment. In this restriction [al-hasr], there is an emphasis that is not hidden.