"Whoever mourns for Jerusalem will be will [merit to] see its rejoicing, and all who do not mourn for Jerusalem will not [merit to] see its rejoicing."
The simplest understanding of this statement of the Sages is that Hashem operates middah k'neged middah (measure for measure). If a person acts according to God's wishes and is appropriately distressed over the destruction of the Beit HaMikdash, he will be rewarded with the opportunity to rejoice when it is rebuilt. If not, he won't deserve such a reward. In short: "If you show me you really want it, I'll give it to you, but if not, then I won't." This simple understanding might be true, but it is probably not what our Sages were getting at. There is a deeper meaning here.
In order to attain a deeper understanding of this statement of our Sages we must first examine the obligation of aveilut (mourning) on Tishah b'Av. Many people ask the question, "Why do we mourn for Jerusalem on Tishah b'Av?" This may be an important question, but it certainly is not a strong question. One could simply answer: "Because we are sad about the destruction of the Jerusalem and the Beit haMikdash," and that would be the end of it. There is a stronger, more specific question we can ask: "Is our mourning on Tishah b'Av consistent with the structure of normative, halachic aveilut?" To understand this question and find an answer we must take a brief look at the halachic structure of aveilut.
Normative halachic aveilut takes place in three stages: the seven days of lamenting, the thirty days of weeping, and final twelve months, after which no more memorials may be held for the dead. In each progressive stage, the severity of the strictures imposed upon the mourner is reduced. In each stage, the mourner is expected to grieve less intensely. After the end of the period of mourning, the mourner is expected to move on with his life. The main point: normative aveilut is time-bound.
Ostensibly, it seems as though the aveilut of Tishah b'Av is not normative. Normative aveilut shouldn't last past twelve months, and here we are, still crying over the destruction of Jerusalem after nearly two thousand years – a blatant breach of the clearly defined time boundaries of halachic aveilut! Not only that, but normative mourning lessens in intensity as time goes by, but with each Tishah b'Av that passes, our mourning increases! Furthermore, the Rambam says, "One should not indulge in excessive grief over one's dead, as it is said: "Do not weep for the dead, nor bemoan him,” meaning, (do not weep for him) too much, for [death] is the ‘way of the world,’ and he who frets over the ‘way of the world’ is a fool.” It comes according to the Rambam that our aveilut on Tishah b'Av not only oversteps the bounds of normative aveilut but is also considered to be foolish! What is going on here?
It turns out that we are not the only ones who mourn (or have mourned) excessively. We know that Ya'akov Avinu mourned for twenty-two years for (what he believed was) the loss of his son, Yosef: “Then Ya'akov rent his garments and placed sackcloth on his loins; he mourned for his son many days. All his sons and all his daughters arose to comfort him, but he refused to be comforted.” This is an outright contradiction to the halachic principles mentioned by the Rambam! How can it be that Ya'akov, one of the most righteous men to walk the earth, refused to be consoled, in stark opposition to the demands of halacha?
The answer lies in a distinction between normative aveilut and the aveilut of Ya'akov Avinu. This distinction is alluded to in the Midrash: "A person does not accept consolation over a living person whom he believes to be dead (savur sh'meit), for a [Divine] decree has been issued over one who has died that he be forgotten from the hearts [of the living], but this decree is not [issued] over one who is still alive.” The simple meaning of this statement is as follows: one cannot be consoled over the death of a loved one until he has undergone yei’ush – until he has given up hope. The mourner must know and feel with absolute certainty that the person is dead and won't be coming back. When a person loses a loved one, he intellectually knows that that person is dead, but emotionally, his love still reaches out for that person. When he (emotionally) realizes that the person is no longer there, he becomes incredibly frustrated and distressed. The gap left behind by the deceased creates a gap between the mourner's mind and his heart, generating intense feelings of anxiety, confusion, and depression. Mourners tend to go through this intellectual/emotional battle for a period of time after the death, but eventually, their emotions catch up with their intellectual realization that the person is dead. Only then do they truly give up hope in both their minds and their hearts. Only then can they fully be consoled, and continue on with their lives.
Now we can see the distinction. Ya'akov's case was different. He could not be consoled. Why not? Because he had not given up hope. He was only believed that Yosef was dead, but he didn't know with complete certainty. He lacked that absolutely conviction necessary for the intellectual confirmation. If a mourner knows in his mind that his loved one is dead he may struggle emotionally, but his heart will eventually catch up with his mind. Emotional acceptance will eventually follow intellectual acceptance. But if a person lacks that intellectual conviction, consolation is impossible. As long as there remains room for doubt – even a remote possibility that the person is still alive – the mourner will invest his entire mind and heart into that possibility and refuse to let it go. The emotional acceptance will never come because the intellectual acceptance never took place. That is why Ya'akov's aveilut exceeded the normative boundaries of halacha. He was unable to be consoled because his mind had never fully accepted Yosef's death. To summarize, there are two objectives accomplished by mourning: 1) honor for the deceased, 2) closure for the living. The process of aveilut helps the living recognize and acknowledge the tragedy that has occured, and helps them get over it. So long as that second step remains unfulfilled, the process of aveilut can never end.
Back to Tishah b'Av. The Shulchan Aruch writes, "We do not say tachanun (Rema: or selichot) on Tishah b'Av and we do not fall on our face in supplication because Tishah b'Av is described as a moed (festival).” This is a very strange phenomenon indeed. On Tishah b'Av we cry, mourn, afflict ourselves with fasting and the other four forms of affliction, refrain from studying Torah, refrain from donning festive clothing, and deprive ourselves of nearly every single pleasure – yet, we modify our observance of Tishah b'Av because we recognize it as a partial moed. Why should this be? It would be understandable if we made it a point to omit all moed-aspects until the arrival of Moshiach, when all fast-days will be nullified and celebrated as festivals; that way, we would be drawing a full contrast between now (exile) and the future (redemption) . . . but that is not our practice. Instead, we take two completely antithetical themes – joyous moed and mournful fast – and bend over backwards to make sure both aspects are demonstrated and acknowledged. Why do we do this? Why try to uphold this paradox of including aspects of moed on a day of nation-wide mourning?
The Aruch haShulchan provides an insight into this conundrum. He explains that we refrain from reciting tachanun as a demonstration of our faith in the redemption. Based on our understanding of Ya'akov's aveilut, we can understand the paradox. Our aveilut, like that of Ya'akov Avinu, oversteps the time-boundaries of normative halachic aveilut. Ya’akov continued to mourn because he could not be consoled. Why not? Because he had not yet given up hope over his situation. The same is true for us. The reason why we continue to mourn is because we have not given up hope over our situation. We fully trust in Hashem's promise that He will redeem us from our exile. We know that the exile is only temporary, and that the redemption can come at any moment. In fact, we are better off than Ya'akov. He was only savur sh'meit – he just thought that there might be hope. We know that there is hope, because Hashem has given us His promise!
Now our previous problem can be resolved. The clash of moed and aveilut on Tishah b'Av is no paradox. In fact, quite the opposite is true. By observing the moed characteristics of Tishah b'Av, we are demonstrating the reason why we continue to mourn and why we can't accept consolation: we can't be consoled precisely because we haven't given up hope! We have refused to be consoled for nearly two thousand years because we have not given up hope. We know that Hashem will redeem us.
Now we can fully appreciate the statement: "Whoever mourns for Jerusalem will merit to see its rejoicing, and all who do not mourn for Jerusalem will not see its rejoicing." Why does a person who mourns deserve to be redeemed? Because the fact that he continues to mourn is a demonstration of his conviction in the redemption! Conversely, one who does not mourn demonstrates the fact that he has "gotten over it;" by not mourning he is demonstrating that he has given up hope of redemption. Since he has demonstrated a lack of faith in the redemption and the rebuilding of Jerusalem, he does not merit to see its rejoicing
 Masechet Ta'anit 30b
 Rabbeinu Moshe ben Maimon (Rambam / Maimonides), Mishah Torah: Hilchot Aveilut 13:10
 Sefer Yirmiyahu 22:10
 Rabbeinu Moshe ben Maimon (Rambam / Maimonides), Mishah Torah: Hilchot Aveilut 13:11
 At this point, Rabbi Fox made it clear that he was not in any way denegrating the aveilut on Tishah b'Av. He said that all of the mourning practices on Tishah b'Av make perfect sense, and that he is merely questioning the fact that the aveilut of Tishah b'Av deviates from normative halachic guidelines.
 Rabbeinu Shlomo ben Yitzchak, Commentary on Sefer Bereisheet 37:34
 Sefer Bereisheet 37:34-35
 Cited by Rabbeinu Shlomo ben Yitzchak, Commentary on Sefer Bereisheet 37:34 from Bereisheet Rabbah 84:21; see also Masechet Pesachim 54b
 Rabbi Fox explained that although the term "decree" sometimes refers to miracles, that simply cannot be the case here. If this were a miraculous phenomenon, then Ya'akov should have known that Yosef wasn't dead from the fact that he was still sad after a year had passed. Furthermore, if this phenomenon were miraculous, we wouldn't have to worry about agunot (an agunah is a woman whose husband is believed to have died, but his death is not confirmed. She cannot remarry until it is established for a fact that her husband is dead). All you would have to do is ask the agunah, "Are you still sad?" and if she answered negatively, you could just say, "Yup! He's dead!" Obviously, if this phenomenon were miraculous, we wouldn't need the entire halachic process of establishing the death of the husband and we would never have to worry about agunah problems. Thus, the Midrash must be referring to a psychological phenomenon.
 Rav Yosef Kairo, Shulchan Aruch: Orach Chaim 559:14
 Rabbeinu Moshe ben Maimon (Rambam / Maimonides), Mishah Torah: Hilchot Ta’aniot 5:19
 Rav Yechiel Michel Epstein, Aruch haShulchan: Orach Chaim 559