In a song sung during a Passover Seder, the phrase "הלילה הזה" (halaila haze), "this (masculine) night" confirms that לילה (night) is masculine, despite ending on a ה (He).
Most often a He at the end of a word marks a feminine form (and replaces an original Taw doing that same job).
מה נשתנה?
What changed?
There are five reasons a word could end on He, as far as I know.
1. The word is feminine and the He replaces an original Taw.
חברה, javera, female friend (I use "j" to write a voiceless pharyngeal fricative similar to German "ch" in "Bach".)
2. The word belongs to a third person feminine singular.
חברה, javera, her male friend (a lot of this context, modern Hebrew uses חבר שלה, the male friend of hers)
3. The word is a masculine pronoun or number.
אתה, ata, thou (male)
שלולה, shlosha, three (male)
4. The word just happens to end on He.
היה, haya, he was
קרה, qara, it happened
5. The other reason.
Noun cases (almost) died out in Biblical Hebrew. Only a few instances of Genitive markers remained (and plural nominative markers stayed on). But one case survived, an allative case for a movement towards something.
Hence "הביתה" (habaita) means "towards home" and "צפונה" (šafona) means "northward" ("š" is my emphatic "s", like "ts" or German "z") and "שמה" (shama) means "to there" (i.e. "thither").
Since the root of לילה appears to be ליל (which is also the root and the word for "night" in Arabic), I am assuming now that לילה is an allative case of ליל and originally meant "towards the night" or "tonight". Over the centuries the nominative form of the word simply died out and only the allative was ever used in all positions.