Answer: As part of an equipment safety test.
When prepping for spaceflight you have to test everything, often multiple times, in order to make sure that things will not go wrong in an actual mission launch. However, in order to make sure things will go right, sometimes you have to intentionally make them go wrong.
That’s why SpaceX intends to launch a rocket this weekend and then promptly cause it to explode. The Falcon 9 rocket will be used to launch the private space exploration company’s Crew Dragon capsule, which will eventually be carrying astronauts into space. The company wants to make sure that the Crew Dragon can be safely separated from the rocket in the event that something goes wrong during launch.
On Jan. 18, 90 seconds after launch, engineers will shut off the Falcon 9’s first stage engines to create a “rapid unscheduled disassembly.” That’s a highly scientific way of saying “explosion.” If all goes well, or as well as it can considering things will literally be blowing up, the Crew Dragon capsule should engage its thrusters and fly away from the rocket before engaging parachutes and landing in the ocean. In that case, any crew members would be safe in the capsule.