Whether a Spanish word is feminine or masculine often is a function of etymology. If a word came from Latin, and it was masculine in Latin, it became masculine in Spanish. If a source word was feminine in Latin, it became feminine in Spanish.
However, there is at least one exception, as I discuss below, for which I cannot find a ready explanation.
La clase, la torre and la gente come from the feminine Latin words, classis, turris and gens. DRAE access 19 Sept 2014; Latdict access 19 Sept 2014. Hombre and pie come from the masculine Latin words homo and pie. DRAE; Latdict.
Equipaje comes from the Spanish verb equipar, which in turn is from the French verb équipar. DRAE. In French, the noun équipage is masculine. Collins English-French Dictionary access 19 Sept. 2014. Interestingly, equipage also is an archaic English word that entered the language in 1570. Online Etymology Dictionary access 19 Sept. 2014. A likely reason for equipaje to be masculine is that the -aje words entered Spanish from French in the 16th Century or earlier, and the source words were masculine in French at that time.
Similarly, coraje comes from the Old French word corages. DRAE. It is difficult to find quickly a source that provides the gender of corages, but the modern French courage, as well as the modern words coratge (Catalan) and coraggio (Italian), are masculine. Collins Dictionaries access 19 Sept. 2014. It thus appears likely that these Romance words developed from Vulgar Latin languages in which classical Latin neuter nouns became masculine. "Vulgar Latin," Reference.com access 19 Sept. 2014. In classical Latin, the related words cor and cordis were neuter gender. Latdict.
La sangre does not fit the pattern. It comes from the masculine Latin word sanguis. DRAE. In modern Catalan, French and Italian the words for blood are masculine. There is an online source that provides theories about why sangre became feminine in Spanish, but I have found that the source is unreliable. This is a good issue to research if you are interested in Etymology.