Checkpoints are used so you don't have to restart the level all over again.
After you die, do you really want to wait behind this wall? Probably not, so the checkpoint will put you at the flag after you reach it.
Collect the chest to complete the example
This is begginers example for checkppoints, check out my other checkpoint examples for different types.