Position: It's kind of nuts that caves are really insecure. Doesn't tally with reality particularly, isn't intuitive for newer players, and makes life kind of boring for people who want to make cave dwellings and settlements.
Solution 1: palisade-level doors for caves. Would have to be destructible/siege-weapon-able from either side, costing a similar amount to a new palisade (leather, glue, wood and rope). I'd also argue they should be quite rapid decay (like no more than half a real-world week) if outside a claim, to stop people stoppering up all the caves permanently so new players can't enter them, but similar slow decay to a palisade if on a claim (at which point new players can't enter them anyway). In fact possibly they should only be buildable if you've claimed the entrance from the outside or inside?
Solution 2: new option to toughen/reinforce a cave wall. Effectively making the tile a much, much harder rock type by giving it an outer layer with, I dunno, clay and stone or something. This would make securing some cave areas from the inside easier by making it hard to tunnel round aa wall, and would make it harder to grief mines because you could reinforce cave-in tiles.
Would it be balanced? I think solution 1 certainly would be. It makes caves a much more workable early to mid game option by stopping them being so insecure to anyone with trespassing. But caves are still arguably less secure than palisades above ground even with this change, because a) people can get in through another part of the cave system and b) people can minehole down into them sometimes. And if you're busy palisading a cave, that doesn't protect your crops etc. But it would make living in a cave more viable.
Solution 2 is more difficult to see all the implications of. I think it would work, albeit probably imperfectly, and at least insofar as it made it more possible to wall off a tunnel if you wanted to do so and would make mining-warfare a real operation to try and push round any reinforced areas and get into an enemy's less protected active mine veins or, more likely, to have to attack down cave tunnels into waiting palisades which would feel rather closer to the tightness one might expect in underground warfare.
It is necessary? Depends who you ask. Because it's still slightly suboptimal, it shouldn't make a big game balance difference. But also... some of us like living in caves? Like, it's quite plausible that at some point I'll get to a stage of this game (indeed I think I may be reaching it, given I've been raided/robbed more than once lately) where if I want to keep playing I have to abandon my rock-cut halls and go copy the same farm-and-hut layout as every other settlement in the area. But as the game/play culture pushes me towards that, I'm finding I'm kind of losing interest honestly. I don't really want to get into PvP combat a lot, and the non-PvP play culture is nearly nonexistent because the PvP culture is so dominant you have to assume everyone is going to kill you and take your stuff always because it's likely true (unless you join a big guild/city discord or something) - so really most of the fun of the game for me comes from building and making cool things and having a nice looking little base, and having to scrap that too does feel a bit of an "OK so why am I playing this again?" moment.