Why do we learn Gemara? We can't learn any Halacha from Gemara, as brought in Yalkut Yosef Halachot Talmud Torah. So why do we learn Gemara at all-it's more useful to learn Halacha!
The last Maharsha on Sha"s explains that the reason the statement of "כל השונה הלכות בכל יום וכו" is cited at the end of Niddah (and after quoting the chumra of Rebbi Zeira in Megillah 27b) is because the chumra of Rebbi Zeira made much of hilchos Niddah obsolete. A person might think that, therefore, there is no more reason to learn maseches Niddah. Therefore this statement is brought to show that learning the halachos of meseches Niddah itself is what brings a person to Olam Habah. (The Maharsha there explains how he knows this statement of learning halachos refers to halachos of Niddah which were made obsolete by Rebbi Zeira's stringency.) There is an intrinsic value to learning Torah.
R' Moshe Feinstein in Igros Moshe Orech Chaim 1:20 explains that this was the mistake of the generation in which the Mikdash was destroyed - they did not make a blessing on learning Torah (Eicha Rabba) - which means they did not relate to learning Torah as a mitzvah in its own right, but only as a means to knowing what to do. They failed to see the intrinsic value in learning Torah.
On a separate note, when I was in Ner Israel, my Rebbe was often asked why we don't learn things that are practical. He explained that if you are learning Gemara and it doesn't become practical, you aren't learning it correctly. If you think learning Gemara is one discussion, and learning the halacha is a separate discussion, you haven't learned either properly. You cannot fully appreciate the Rambam, or Shulchan Aruch, or wherever your halacha is coming from, if you do not know the ins and outs of the sugya in the Gemara. Learning Gemara is a necessary step in learning the halacha, and just perusing the Mishna Berura does not give you a true understanding of the subject at hand.
1) Inculcating Toil
Gemara study does not just represent a new concentrated degree of learning, the intricacies contained within its pages, usher the onset of heightened עמילות – toil.
The Chofetz Chaim (Toras HaBayis, maamar 'Elbona shel Torah") explains in length that this עמילות inspires an unparalleled level of דביקות - closeness to Hashem.
יסוד אומתינו ויסוד תקנת איש יהודי נאמן לאלקיו להשאיר בנו אחריו דבוק בד' תורתו ואשר לא תהיה זאת רק מלימוד הגמרא בעמל ויגיעה שבדבוקתם בקדושתה באורה ובכבודה
The foundation of our nation and the foundation of perfecting a Jewish man faithful to his G-d is to leave his son behind him clinging to his Torah, and this is only from studying the Gemara with toil and effort and it will come that you cling to it in its holiness in its light and honour.
Building on this point - it is worth taking a look at Rav Yitzchok Hutner's Pachad Yitzchok on Shavuos (17:1). He notes there Rambam's advice in Hilchos Torah 1:11:
וְחַיָּב לְשַׁלֵּשׁ אֶת זְמַן לְמִידָתוֹ. שְׁלִישׁ בַּתּוֹרָה שֶׁבִּכְתָב. וּשְׁלִישׁ בַּתּוֹרָה שֶׁבְּעַל פֶּה. וּשְׁלִישׁ יָבִין וְיַשְׂכִּיל אַחֲרִית דָּבָר מֵרֵאשִׁיתוֹ וְיוֹצִיא דָּבָר מִדָּבָר וִידַמֶּה דָּבָר לְדָבָר וְיָבִין בַּמִּדּוֹת שֶׁהַתּוֹרָה נִדְרֶשֶׁת בָּהֶן עַד שֶׁיֵּדַע הֵיאַךְ הוּא עִקַּר הַמִּדּוֹת וְהֵיאַךְ יוֹצִיא הָאָסוּר וְהַמֻּתָּר וְכַיּוֹצֵא בָּהֶן מִדְּבָרִים שֶׁלָּמַד מִפִּי הַשְּׁמוּעָה. וְעִנְיָן זֶה הוּא הַנִּקְרָא גְּמָרָא
A person is obligated to divide his study time in three: one third should be devoted to the Written Law; one third to the Oral Law; and one third to understanding and conceptualizing the ultimate derivation of a concept from its roots, inferring one concept from another and comparing concepts, understanding [the Torah] based on the principles of Biblical exegesis, until one appreciates the essence of those principles and how the prohibitions and the other decisions which one received according to the oral tradition can be derived using them. The latter topic is called Gemara. (Sefaria translation and notation)
Rambam continues in the subsequent halacha:
בַּמֶּה דְּבָרִים אֲמוּרִים בִּתְחִלַּת תַּלְמוּדוֹ שֶׁל אָדָם אֲבָל כְּשֶׁיַּגְדִּיל בְּחָכְמָה וְלֹא יְהֵא צָרִיךְ לֹא לִלְמֹד תּוֹרָה שֶׁבִּכְתָב וְלֹא לַעֲסֹק תָּמִיד בַּתּוֹרָה שֶׁבְּעַל פֶּה יִקְרָא בְּעִתִּים מְזֻמָּנִים תּוֹרָה שֶׁבִּכְתָב וְדִבְרֵי הַשְּׁמוּעָה כְּדֵי שֶׁלֹּא יִשְׁכַּח דָּבָר מִדִּבְרֵי דִּינֵי תּוֹרָה וְיִפְנֶה כָּל יָמָיו לַגְּמָרָא בִּלְבַד לְפִי רֹחַב שֶׁיֵּשׁ בְּלִבּוֹ וְיִשּׁוּב דַּעְתּוֹ
The above applies in the early stages of a person's study. However, when a person increases his knowledge and does not have the need to read the Written Law, or occupy himself with the Oral Law constantly, he should study the Written Law and the oral tradition at designated times. Thus, he will not forget any aspect of the laws of the Torah. [However,] he should focus his attention on the Gemara alone for his entire life, according to his ambition and his ability to concentrate. (Sefaria translation & notation)
Rav Hutner builds off the Rambam to make the following point:
הרי לנו דעצם עצמיותה של תורה הוא רק לימוד גמרא, וכל מהלכי הלימוד הם כמו הדרך המוביל אל המטרה. וזהו חידוש נפלא, דבעצם עצמיותו של תלמוד תורה אין אנו דנים על כל חלקיו בהשואה אחת. אלא דהכל נידון בערכין. ובערכה של תורה, כל המהלכים מלבד תלמוד גמרא כמכשיר הם נידונים
After all, for us, the essence of Torah's identity is only the study of Gemara, and from all the approaches to learning they are like the road leading to the ultimate goal (i.e. learning gemara). And this is a wondrous chiddush, since the very nature of Talmud Torah is such that we do not discuss all its parts equally. Rather, everything is judged on its merits. And with the value of Torah, all approaches other than the learning of Gemara are considered part of the preparation.
In other words, Rav Hutner tells us that all our other Torah learning is to be regarded as a means to get to the end goal, which is purely that of Gemara study. Now why is it regarded as the ultimate aim? Rav Hutner continues that it inspires a greater sense of toil. This toil that is so part of Gemara study is not to be deemed as added value but rather represents the very definition of Torah study.
In 17:5 Rav Hutner notes that Rambam defines the learning of Gemara as the final third (as this is the final piece that everyone should be building up to) as understanding and conceptualising the derivation of a concept from its roots, inferring one concept from another and comparing concepts. As such:
הוא עיקר מקומו של השכל העמל בהתבוננות העיון לעומקו ולהקיפו של ענין, בהתאמצו להוציא דבר מתוך דבר
It is the main place of the intellect that toils in the observation of the study to the depth and scope of a matter, in an effort to extract something from something.
Thus, the more regularly we do this, the more ingrained it becomes in our thinking process, thereby refining our ability to probe Torah thought as well as enhancing the breadth of our Torah knowledge.
2) Foundational Building Blocks
Rav Aharon Kotler זצ"ל in Mishnas Rebbi Aharon, cheilek gimmel, shaar asiri, p. 168 asserts that the study of גמרא must be emphasised as it concretises a person’s basic ידיעת התורה – knowledge of Torah, and it must already be firmly introduced from a an appropriate age because it plays such an important part of further study in a person’s life.
In this vein, it is worth bringing the Gemara in Gittin 60b which notes the primacy that Torah sheba'al peh is afforded:
אָמַר רַבִּי יוֹחָנָן לֹא כָּרַת הַקָּדוֹשׁ בָּרוּךְ הוּא בְּרִית עִם יִשְׂרָאֵל אֶלָּא בִּשְׁבִיל דְּבָרִים שֶׁבְּעַל פֶּה שֶׁנֶּאֱמַר כִּי עַל פִּי הַדְּבָרִים הָאֵלֶּה כָּרַתִּי אִתְּךָ בְּרִית וְאֶת יִשְׂרָאֵל
Rabbi Yoḥanan says: The Holy One, Blessed be He, made a covenant with the Jewish people only for the sake of the matters that were transmitted orally [be’al peh], as it is stated: “For on the basis of [al pi] these matters I have made a covenant with you and with Israel” (Exodus 34:27).
Thus, whilst Torah Shebichsav represents the written word of G-d, the Oral Torah is to be understood as the process and application of His word, that Hashem gifted uniquely to us. It is the means through which the Rabbonim throughout the ages, as well as each and everyone of us throughout the generations have the ability to attach ourselves to in order to gain a greater foothold of understanding and that is why it is prioritised.
Perhaps the Ksav VeHakabbalah on the pasuk quoted in the gemara there puts it best:
ביאור הדבר שהיה נפלא ומכוסה ונעלם הידיעה, והיא התורה שבעל פה המסורה לנו לבאר התורה שבכתב
The explanation of the matter is wondrous and covered up, and the knowledge is concealed, and the Oral Torah was given to us in order to explain the Written Torah.
3) Acceptance of G-d's Kingship
When delving deeper into the piece from Gittin 60b above, I came across this here which provides yet another reason why the learning of Gemara is emphasised above that of other Torah learning.
Rav Pinchas Koretzer, zt”l, gave another reason. “If Hashem had chosen to commit the oral Torah to writing, we would not be able to say any more than what was written down, just as one may not add or subtract to scripture. This would be very detrimental, since the only way to truly master the intricacies of oral Torah is to speak in learning and review the material in an individualized way. With each review, it gets clearer and clearer to the learner. This is why the Tikunei Zohar teaches that the oral Torah is an aspect of accepting Malchus Hashem. The difficult process of mastering the oral Torah is how we truly accept Hashem’s Kingship over us!”
(אמרי פנחס, שער התורה, מ"ג)
In truth you can't necessarily pasken directly from Halacha seforim either. Paskening directly from how you understand the Mishna, Rambam, Shulchan Aruch or Ramo, and really any such terse statements, has long been warned against (the Mishna is warned against in the Gemara itself, and the exact parameters of the problem learning the Rambam, etc. directly is a discussion in Rishonim, with disagreements about it).
The necessity of learning Gemara is to understand the source of the Halacha in order to understand its applicability to new situations. Without going back to and understanding the source, you cannot properly and clearly understand the Halacha in Halachic seforim, by and large, and you certainly cannot apply it to new situations correctly.
The answer to your question is in gemara kiddushin 30a where the gemara says a person should divide his week by learning three studies. Chumash, Mishna, and Talmud. the Tosafot there says that the reason why we learn gemara over Yerushalmi and I can apply this to Halacha and Chumash and Mishna also since gemara has chumash and mishna and even halacha or at least the base of halacha. That is why we learn gemara over the other 3.