The question should be: Why isn’t all sugar brown? Sugar is dark colored when it is extracted from the sugar cane plant.
Most sugar appears white because it is filtered in such a way as to remove the brown coloring. Brown sugar is prepared so that its crystals are allowed to retain a thin coating of dark sugar syrup.