"Sofa" is masculine in French, so James' guess is likely to be right.
However, although most nouns ending in -a are feminine, there are a few ones (mostly Greek, but also from other languages, like sofá) that are masculine despite their ending, and they just have to be memorized, unfortunately. Some of the most common exceptions are:
panda (also in feminine)
Notice that many of them end in -ma (from Greek).
P.S. I didn't see samdie's post.
It might be because it was considered a foreign word. It came from French, sofa, which came from the Persian 'offe, which came from Classical Arabic 'uffah. The accent has nothing to do with the gender.
Or maybe the Spaniards sprinkled in a few words like this just to trip up foreigners, so they could spot any spies. hehe
There are many words in Spanish that were borrowed from Greek that end in "a" (mostly that end in "ma" that are masculine). In these cases the usual practice was to preserve the gender that the words had in the original Greek. But, speaking more generally, loan words are much less likely to preserve the "a"=feminine "o"=masculine rule (and even in Spanish there are exceptions (e.g. el día).
Actually I didn't think that the word sofa carried an accent in Spanish.
oh, but I see that it does...
So the next question being is it 'un sofá nuevo o nueva? More general question being, in these examples, does the adjective follow the gender or the spelling of the noun?
The adjective always matches the noun in gender and number. It does not matter if the word ends in an "a" or "o".