Some words in Spanish are just like that. To determine whether it is feminine or masculine, we depend on the definite articles to help us out. Unfortunately, that is not provided in this case. So you really just have to use your best judgement and use the process of elimination to determine your final answer.
If you have any more questions, let me know!
Hope this helped !! :)
Many rules and many exceptions. https://www.spanishdict.com/guide/masculine-and-feminine-nouns
"Facil" is an adjective describing the class. In the sentence "una clase de español", the word "español" is not an adjective, it is the subject of the class; therefore "Spanish class", or class of (teaching) Spanish. The Spanish class might be easy or hard, depending on your level of knowledge.