Why do some nouns end with "a", yet are masculine?
En mi clase de español, my teacher was teaching us how to add a verb into our sentences, like "El artista pinta." and "El poeta publica.". However, (and I did not have time to ask her this), why is "el artista" and "el poeta" using the masculine form of "the"? It obviously looks feminine to the inexperienced, and I got quite confused about this. Is it just because it is one of those words that is simply masculine? Or did mi profesora make a mistake? I would be very grateful if someone could clear this up for me. Gracias.
No, your teacher got it right. There are rules and exeptions, like the ones you mentioned. It also works the other way round, e.g. "la mano". I think you'll find this article quite helpful.
Is it just because it is one of those words that is simply masculine?
Nouns in Spanish are simply masculine or feminine (although there are a handful that can be either (are hermaphroditic?). The problem is that someone told you that the "rule" is that nouns that end in "a" are feminine. This is not a rule; it's a generalization (and would be more precisely phrased as "most nouns that end in "a" are feminine [and most nouns that end in "o" are masculine]).
Grammatical gender is not a question of rules/logic but, rather, of custom/tradition. In many cases a noun's gender is whatever it was in Latin/Greek (and has nothing to do with the meaning of the word).
As a simple matter of probabilities, if you see a word ending in "o"/"a" that is unfamiliar, you would do well so assume that it is masculine/feminine (but that's only because it's the "odds on" assumption). If the generalization does not apply in a particular case, it is pointless to ask "Why?" (because the only real answer is, "Because that's the way it is.")
Span¡sh D!ct also has a great Reference Article explaining the genders of nouns.
You will find it here ----> Gender of Nouns
If you go over to look at it, and I encourage you to do that, have a look at what is in our Reference Library. There is a lot there that you are going to have to deal with in school. It really is a treasure trove and the Index Page has links to a huge amount of information. I suspect once you know about it you will return often.
Here is the Index Page ----> Span¡shD!ct Reference Library Index