To answer the question seems trivial: because they are pretty, cool, fun, whatever. Yet these answers beg further questions. Answering them seems far from trivial judging by the volume of answers already given on such topics. But for me, these questions are not nearly as difficult as this one: what are fireworks?
The least vexing problems arising from this question are those that play with language, definitions being a prime example. How does one define the word "firework"? One example (from the New Oxford American Dictionary):
1. a device containing gunpowder and other combustible chemicals that causes a spectacular explosion when ignited, used typically for display or in celebrations.
2. (fireworks) a display of fireworks
Even this efficient definition reveals one source of ambiguity - that between the device and the display of the device in its functioning. (Particularly delicious is the use of recursive definition to explain the latter case.)
This particular ambiguity is one that isn't relegated to understandings of fireworks. In fact, the way that this particular definition is presented mirrors a schism in our understanding of the way "things" "be".
There are many ways of understanding how "things" "be".One view, which is Classical in origin, holds that a thing consists of what it is made out of - its form, materials, etc. This view has the advantage of conceding that the universe has an independent existence from ourselves. However, it has two particularly pernicious problems. One is that by positing a thing is made of some other thing, it begs the question of what the other thing is made of. The Greeks answered this question by positing atoms, those things that are not made of yet other things. We now acknowledge the presence of atoms, but we further maintain that they are not atomic, being made up of electrons, neutrons, and these being made up of other sub-atomic particles.
The other problem is that by positing the existence of "things" independent of our own being, we ignore the fact that things themselves exist only when we make judgements about what we perceive. (To be accurate, perceptions are actually influenced by our judgement.) Differentiation is a psychological process and without it, the difference between a rock and a chair are irrelevant. Thus, another way of understanding how "things" "be" is to state that things are how we perceive them.
If one assumes that things are how they are perceived (which is not the right answer, because there is no right answer), the question "what are fireworks?" is replaced by the more specific "how are fireworks perceived?". This question cannot be answered comprehensively as perception changes relative to context. A firework can be seen as a configuration of materials in one context (before they are lit) and as an configuration of colors in another (when they are in the sky.)
For the sake of argument, assume that the most relevant context is the one in which fireworks are displayed in the sky, illuminating the night. We can say that we are perceiving plastic objects being propelled into the air, exploding, and expelling their colored-burning remnants far from the point of explosion. Yet this is not all that is perceived. Neither do we perceive only an arrangement of colored lines and points in the sky. Rather, we perceive a transformation of perception of fire and sky into patterned figure and ground (respectively.)
Fireworks, like other arts, confront and disarm perception. They remind us that things are perceived not according to how they are made, but to how we are made. They make us remember that things might not always be how we think they "be".