By killing Yoav inside the tent the Aron and the Altar that were there became impure. Wasn't this a problem? See 1 Kings 2 (28 -34).
I have a partial answer to this question:
A number of commentators point out that the place Yoav escaped to wasn't where the Ark was located in Yerushalayim, but to the Mishkan in Givon:
Rashi on Melachim 1:50 writes:
"Of the horns [of the corners] of the Altar. Which was in Givon. He said, “Those who are executed by Beis Din are buried in the graves of Beis Din. I will die here, and be buried in the graves of my forefathers.”
While this is referring to Adoniyah, Rashi quoted in his commentary something the midrash attributed to Yoav. From this one can understand that the midrash, which spoke about Yoav's escape, speaks about him escaping to the altar in Givon (per Rabbi Eitan Shendorfi).
Ritva on Makot 12a also says that the altar Yoav escaped to was the one in Givon.
R' Tzvi Binyamin Wolf in his book "Melachim According To The Mesorah" notes that in "Ohel Hashem" in Yerushalayim there wasn't the altar built by Moshe, because that was in Givon, and in the bamah there weren't "horns" on the altar that had any halachic significance (meaning, there might have been horns, but they weren't an integral part of the alter, thus, it would be meaningless to grab onto them). For these reasons, it seems more likely that Yoav fled to the altar in Givon.
This is a significant point, because the Ark was never in Givon (among sources, Tosefta Zevachim 13:8 which says that in in a big bamah there wasn't the Ark and in Melachim 1:3:4 it says that the big bamah was in Givon and Yerushalmi Megillah 17b which says that when the Mishhkan was in Givon, the Ark was in Kiryat Ye'arim (and see here as well)). Therefore, there was only the danger of making the altar impure and not the Ark.
As for the altar, it seems the altar wasn't in any danger of becoming impure, because the mishna in Chagigah 3:8 says:
"All the vessels that were in the Temple required immersion after the Festival, apart from the golden altar and the bronze altar, because they are considered like the ground and therefore, like land itself, not susceptible to impurity. This is the statement of Rabbi Eliezer. And the Rabbis say: It is because they are coated."
And the altar in Givon was a copper coated altar, as it says in Zevachim 61b:
"Rav Huna says that Rav says: The altar in Shiloh was fashioned of stones. This is as it is taught in a baraita: Rabbi Eliezer ben Yaakov says: Why must the verses state that the altar must be fashioned from stones (Exodus 20:22), and state again that the altar must be fashioned from stones (Deuteronomy 27:5), and mention yet again the word stones (Deuteronomy 27:6), with regard to the altar, for a total of three times? These allude to three different stone altars: One in Shiloh, and one in Nov and Gibeon, and one in the Eternal House, i.e., the Temple...Rav Huna stated his opinion in accordance with the statement of Rabbi Natan, as it is taught in a baraita that Rabbi Natan says: The altar in Shiloh was fashioned of copper; it was hollow and full of stones."
However, as stated in the beginning, this is only a partial answer, because it doesn't explain the view of the commentators that believed that Yoav fled specifically to where both the altar and the Ark were located (Metzudat David, Abarbanel and Radak and even Rashi, despite what he appears to have concluded from Tanchuma (not that this isn't the first time that Rashi contradicts himself)).
Rabbi Yaakov Medan maintains that Benayahu first pulled Yoav away from the altar and then killed him, which may explain the view of these commentators.
Another suggestion, brought in Yerushalmi Makot 7a, is that Yoav escaped to the vicinity of the altar, but not to the altar itself. Rather, he went to the Sanhedrin which communed near the altar. According to Tosfot, this is one way to also understand the gemara in Sanhedrin 48b.
The altar that Yoav held on to was the altar in the courtyard, not the altar inside the tent itself.
Why, then, did it mention that he ran away to the "tent"? See the Malbim there, that this alludes to one of the three mistakes Yoav made in thinking that he could not be killed while holding the altar, that he didn't realize that this protection is only provided in the permanent temple.
וחז"ל אמרו שטעה ג' טעיות. ... ב. שאין קולט רק בית עולמים, ועז"א אל אהל ה',