Biblical concept of Sefirah
(טו) וּסְפַרְתֶּ֤ם לָכֶם֙ מִמָּחֳרַ֣ת הַשַּׁבָּ֔ת מִיּוֹם֙ הֲבִ֣יאֲכֶ֔ם אֶת־עֹ֖מֶר הַתְּנוּפָ֑ה שֶׁ֥בַע שַׁבָּת֖וֹת תְּמִימֹ֥ת תִּהְיֶֽינָה׃ (טז) עַ֣ד מִֽמָּחֳרַ֤ת הַשַּׁבָּת֙ הַשְּׁבִיעִ֔ת תִּסְפְּר֖וּ חֲמִשִּׁ֣ים י֑וֹם וְהִקְרַבְתֶּ֛ם מִנְחָ֥ה חֲדָשָׁ֖ה לַיהוה
(15) And from the day on which you bring the sheaf of elevation offering—the day after the sabbath—you shall count off seven weeks. They must be complete: (16) you must count until the day after the seventh week—fifty days; then you shall bring an offering of new grain to the Lord.
וְצִוָּה בְּחַג הַמַּצּוֹת שִׁבְעָה יָמִים בִּקְדֻשָּׁה לִפְנֵיהֶם וּלְאַחֲרֵיהֶם, כִּי כֻּלָּם קְדֹשִׁים וּבְתוֹכָם יהוה, וּמָנָה מִמֶּנּוּ תִּשְׁעָה וְאַרְבָּעִים יוֹם, שִׁבְעָה שָׁבוּעוֹת כִּימֵי עוֹלָם, וְקִדֵּשׁ יוֹם שְׁמִינִי כִּשְׁמִינִי שֶׁל חָג, וְהַיָּמִים הַסְּפוּרִים בֵּינְתַיִם כְּחֻלּוֹ שֶׁל מוֹעֵד בֵּין הָרִאשׁוֹן וְהַשְּׁמִינִי בֶּחָג, וְהוּא יוֹם מַתַּן תּוֹרָה.
From then on [i.e., beginning with the second day of Passover] we are to count forty-nine days[of the omer], which are seven weeks comparable to the [seven] “days” of the world, and then to sanctify the “eighth day” [i.e., the Festival of Weeks] just as the eighth day of Tabernacles [is holy]; and [the forty-nine days] counted between them are in the “intermediate days” of the festival, in the interval separating the first day and “eighth day” of the festival, this being the day of the Giving of the Torah.
Students of Rabbi Akiva Dying
אמרו שנים עשר אלף זוגים תלמידים היו לו לרבי עקיבא מגבת עד אנטיפרס וכולן מתו בפרק אחד מפני שלא נהגו כבוד זה לזה והיה העולם שמם עד שבא ר"ע אצל רבותינו שבדרום ושנאה להם ר"מ ור' יהודה ור' יוסי ורבי שמעון ורבי אלעזר בן שמוע והם הם העמידו תורה אותה שעה תנא כולם מתו מפסח ועד עצרת אמר רב חמא בר אבא ואיתימא ר' חייא בר אבין כולם מתו מיתה רעה מאי היא א"ר נחמן אסכרה.
It was said, That Rabbi Akiva had twelve thousand pairs of disciples, from Gabbat to Antifaras; and they all died at the same time because they did not treat each other with respect. The world remained desolate until Rabbi Akiva came to our Masters in the South and taught the Torah to them. and it was they who revived the Torah at that time. These were Rabbi Meir, Rabbi Judah, Rabbi Yossi, Rabbi Shimon and Rabbi Eleazar ben Shammua; And it was they who revived the Torah at that time. A Tanna taught: All of them died between Passover and Pentecost. Rabbi Hama bar Abba or, it might be said, Rabbi Chiyya bar Abin said: All of them died a cruel death. What was it? — Rabbi Nahman replied: Croup.
נוהגין בכל המקומות שלא לישא אשה בין פסח לעצרת והטעם שלא להרבות בשמחה שבאותו זמן מתו תלמידי ר"ע וכתב הר"י גיאת דוקא נישואין שהוא עיקר שמחה ... ויש מקומות שנהגו שלא להסתפר ויש מסתפרי' מל"ג בעומר ואילך שאומרים שאז פסקו מלמות
(א) נוֹהֲגִים שֶׁלֹּא לִשָּׂא אִשָּׁה בֵּין פֶּסַח לַעֲצֶרֶת עַד ל''ג לָעֹמֶר, מִפְּנֵי שֶׁבְּאוֹתוֹ זְמַן מֵתוּ תַּלְמִידֵי רַבִּי עֲקִיבָא; אֲבָל לְאָרֵס וּלְקַדֵּשׁ, שַׁפִּיר דָּמִי, וְנִשּׂוּאִין נָמֵי, מִי שֶׁקָּפַץ וְכָנַס אֵין עוֹנְשִׁין אוֹתוֹ. הַגָּה: מִיהוּ מִלַּ''ג בָּעֹמֶר וָאֵילָךְ הַכֹּל שָׁרֵי (אַבּוּדַרְהַם וּבֵית יוֹסֵף וּמִנְהָגִים).
(ב) נוֹהֲגִים שֶׁלֹּא לְהִסְתַּפֵּר עַד ל''ג לָעֹמֶר, שֶׁאוֹמְרִים שֶׁאָז פָּסְקוּ מִלָּמוּת.
(1) It is customary not to get married between Pesach and Shavuot, until Lag BaOmer (the 33rd day), because during that time, the students of Rabbi Akiva died. However, to do "erusin" and "kiddushin" (engagement and betrothal) is OK. And even for "nisuin" (marriage), if someone did so, we do not punish him. Rema: however, from Lag Ba'Omer onwards, all this is permitted (Abudraham, Beit Yosef & Minhagim).
(2) It is customary not to cut one's hair until Lag BaOmer, since it is said that that is when they stopped dying.
Why we would celebrate
אמרו על ר' עקיבא ששנים עשר אלף זוגות תלמידים היו לו וכלן מתו בפרק אחד על שלא נהגו כבוד זה לזה והיה העולם שמם בלא תורה עד שבא לו אצל רבותינו שבדרום ושנה להם לר' מאיר ור' שמעון ור' יהודה ור' יוסי ור' אלעזר בן שמוע והם הם העמידו את השעה ותלמידים אלו הוזכר כאן שכלם מתו מפסח ועד עצרת וקבלה ביד הגאונים שביום ל"ג בעומר פסקה המיתה ונוהגים מתוך כך שלא להתענות בו וכן נוהגים מתוך כך שלא לישא אשה מפסח עד אותו זמן:
"They said about Rabbi Akiva that he had twelve thousand pairs of students and they all died in one period of time, because they did not treat each other with respect. And the world was desolate of Torah until Rabbi Akiva came to our Rabbis in the South and taught them - Rabbi Meir, Rabbi Yehudah, Rabbi Yosei, Rabbi Shimon, and Rabbi Elazar ben Shamua. And these are the very ones who upheld the time." And it is mentioned here that these [earlier] students all died from Pesach until Shavuot, but it is a tradition in the hands of the Geonim that the dying stopped on the day of Lag BaOmer - so as a result of that, we are accustomed not to fast on it. And we are also accustomed, as a result of that, not to marry a woman from Pesach [only] until that time.

___________________________________________________
Hakira:
___________________________________________________
Rabbi Chaim Vital born in 1543
Source here
--------
The Rebbe:
By chance I saw your book HaMoadim BeHalachah, 2nd edition, in the library of my revered father-in-law, the Rebbe Shlita. In the section on Lag BaOmer, I found a quotation from the Pri Etz Chayim (as found in the Dubrovna and Lashtchov printing), Shaar Sefiras HaOmer, ch. 7, in the note: “The reason [for the celebration] is that Rabbi Shimon bar Yochai died on Lag BaOmer. He was one of the students of Rabbi Akiva who died during the Counting of the Omer.”
...
This [apparent contradiction] was already discussed in the responsa Divrei Nechemiah, Orach Chayim, Responsum 34, sec. 7, [which] concludes: “Perhaps there is a textual error in the Pri Etz Chayim, in the statement: ‘He was one [of the students]....’ Analysis is required. I heard that in the Karatz printing [of the Pri Etz Chayim], this passage was left out.”
This is in fact true.
----
Chidah born in 1724
יום ל״ג לעומר ירבה שמחה לכבוד רשב״י זי״ע כי הוא יומא דהלולא דיליה. ונודע שרצונו הוא שישמחו ביום זה כידוע ממעשה מהר״א הלוי זלה״ה ומעשים אחרים אשר שמענו ונדעם מפום רבנן קדישי. ויש מי שנהג לעשות לימוד בליל ל״ג לעומר בי עשרה ללמוד שבחי רשב״י המפוזרים בזהר ואדרא זוטא והוא מנהג יפה:
One should add to the joy of the day of the thirty third of the Omer in honor of Rabbi Shimon bar Yochai, may his merit protect us - as it is the day of his memory (the day he died). And it is known that it was his will that [people] rejoice on this day - as is known from the story of our teacher, the Rabbi Avraham HaLevi (Amigo), may his memory be blessed for life in the world to come, and from other stories that we have heard. And we know them from the mouths of holy rabbis. And there is one who is accustomed to engaging in study on the night of the thirty third of the Omer with ten [men] to teach the praises of Rabbi Shimon bar Yochat that are scattered in the Zohar and the Idra Zuta; and that is a nice custom.
___________________________________________________
Kaf Hachaim born in 1870
כו) שם. בהגה ומרבים בו קצת שמחה. לזכר שפסקו מלמות. דרשוא מהרי"ל ר"ז או' יהוה. מיהו הפר"ח הקשה ע"ז וכתב הטעם שהשמחה היא על אותם תלמידים שהוסיף אח"כ ר"ע שלא מתו כאלו יעו"ש. ועיין בשער הכוו' דף פ"ז ע"א שכתב ובבוא יום ל"ג לעומר אז נתגלה קטנות ב' של אי' שהוא שם אכדט"ם אשר באי' והנה הוא חילוף שם אלהים (עיין לעיל או' ה') אשר הוא בחי' רחמים בסוד אלהים חיים וכו' ולכן סמך אח"כ ר"ע את יהוה תלמידיו הגדולים מבחי' יהוה גבורות דגדלות שהם כנגד יהוה אותיות אכדט"ם שהם רחמים ואלו נתקיימו בעולם והרביצו תורה ברבים והם ר"מ ור' יהודה ור' אלעזר בן שמוע ור"ש ור' נחמיה יעו"ש.
Chtam Sofer born 1762
אמנם ידעתי כי שמעתי שעכשיו אכשיר דרי וממרחק יבואו ידרושו את יהוה בע"הק צפת ביום ל"ג בעומר בהלולא דרשב"י ז"ל ואם כי כל כוונתם לש"ש שכרם רב בלי ספק ע"ד ודיגול"ו ודליק"ו נרות עלי אהב' כמ"ש תוס' ר"פ אין מעמידין אבל מטעם זה בעצמו הייתי אני מן הפרושים ... בפר"ח א"ח סי' תצ"ו בקונטרס מנהגי איסור שלו אות י"ד על המקומות שעושים י"ט ביום שנעשה להם נס מהא דאמרי' פ"ק דר"ה קמיית' בטיל אחריניית' מוסיפי' בתמי' [ובמקומו טרחתי הרב' לקיי' מנהג עיר מולדתי ק"ק פפ"דמ העושי' פורי' ביו' כ' אדר א'] ומנהג מצרי' ביו' כ"ג
Can't make holidays after Charban, gemarah taanit, exception is local holidays for specific people who experienced holidays, what about purim (deoraita because kal vachomer slavery vs death), answer is purim is different because people thought it might lead to geulah
וְהִלְכְתָא בָּטְלוּ, וְהִלְכְתָא לֹא בָּטְלוּ. קַשְׁיָא הִלְכְתָא אַהִלְכְתָא! לָא קַשְׁיָא: כָּאן בַּחֲנוּכָּה וּפוּרִים, כָּאן בִּשְׁאָר יוֹמֵי.
The Gemara concludes: And the halakha is that these days were nullified, and the halakha is that they were not nullified. The Gemara asks: This is difficult, as one halakha contradicts the other halakha. The Gemara answers: It is not difficult. Here, it is referring to Hanukkah and Purim. These Festival days were never nullified, and Hanukkah is listed among the Festivals of Megillat Ta’anit. There, the halakha is referring to the rest of the days listed in Megillat Ta’anit, all of which were nullified.