I don't think the Greek origin of words such as Andrea is the issue. There are Italian nouns ending in 'a', such as poeta = poet, which are masculine. I think it more likely that such words, especially when they denote a profession, are remnants of the Latin First Conjugation, where nouns of any gender end in 'a' in the masc. sing. nominative. One of the first sentences learned in Latin I is Marcus est agricola = Marcus is a farmer.