The kind of mourning Jesus is speaking about here is a mourning for sin. This beatitude teaches that such mourning is an essential component of Christian character. Those who mourn in this way are comforted by the gospel of forgiveness in Christ.
Read Matthew 5:4