Why are many military fighter aircraft designed to fly supersonic?
One reason is interception (with interceptor, not missiles).

Defence is probably more important. Defence with fighters is still important for three reasons:


There are relatively effective counter-measures against surface-to-air missiles. A fighter pilot can adjust the strategy to the counter-measures encountered, missile can't.
In peace or limited conflict situations it is often not known whether a suspicious target is hostile at all and the only way to identify it is to have a fighter fly to it and have the pilot identify it with their eyes.
Fighter can also do other things than use lethal force. In peace time you generally don't want to shot down an intruding military aircraft of another country straight away. Fighter can chase it away from your territory or can try to arrest it (force it to land on your own airbase). And fighters are also used to identify and possibly navigate to safety civil aircraft that lost radio contact.


So when a potentially hostile aircraft is detected entering your territory, fighters are sent to intercept it and help it, arrest it or shot it down depending on what it turns out to be.

If the fighters are slower than the intruder, they may not be able to intercept it at all (they don't usually know where it is flying so they can't wait for it). The faster they are, the larger area they can defend. In this case the interceptors take off without external fuel tanks (as they won't be flying very far) and with only relatively small air-to-air missiles, so they can fly fast.

Conversely if you try to penetrate the enemy territory, flying faster limits the number of fighters that can intercept you. However in this case it is more useful to rely on stealth or flying low to evade detection, so attack aircraft often are either not supersonic or have lower maximum speed.