What is the purpose of chazal’s decree of aveilus? Is it that a person is supposed to be sad the whole year? If a person feels himself getting to happy, is he not being mis’abel the right way?
A number of rishonim write that the basis for the twelve months of mourning is the obligation to honor one’s parents. Out of the obligation to honor parents, one must refrain from joyous behavior for the duration of twelve months.
Another explanation is that a year is a microcosm of a lifetime–a full cycle. When a person loses a parent, he loses, as it were, the “source” of his very existence, and he must mourn for an entire year, which represents a lifetime.
There is no obligation to be sad the entire year, but the obligation is not to do things that the Sages considered as bringing joy. There are things that make a person happy even when he is an aveil (an extreme example would be the birth of a child), and if this happens it is not a reason to feel guilty.
Sources: See Ra’anach 2:50; Or Sameach 2:62; Maharam Schick (Yoreh De’ah), Chochmas Adam 168:6; Aruch Hashulchan 396:5; see Shach 344;9, who writes that a father can forego the mourning, also indicating that the entire issue is the father’s honor. See a halachic application of this principle in Iggros Moshe, Yoreh De’ah vol. 2, no. 255.