Why does a flame burn constantly at the Refinery?

This is called a flare. The flare allows excess gases that would otherwise build up high, uncontrollable pressure in the system to be burned. The flare is a safety feature, which burns continuously while the refinery is in operation.