Thaddeus Howze's answer is good but I think more focus has to be placed on the out-of-universe elements.
There are a lot of far more vicious ways to use most of the tech in star trek, holographic security personnel are weaksauce: if you can have a working holographic grenade or machine guns by means of creating force fields there's little need for the actual grenade of machine gun: just use the same fields to rip invaders to pieces.
Even if you want to go non-lethal riot foam and nets materializing around the invaders up to their necks would be an obvious application.
But that wouldn't make very good TV.
There's no tension, there's nothing at stake if "we're being boarded" is followed a few seconds later by "boarding resolved, they're all buried up to their necks in holographic taffy and being rolled to the brig"
Com badges get lost etc but the ship so regularly loses lots of crew to boarders that pretty much any such system would entail less death and destruction on the ship.
Every second week the crew of the enterprise suffer amnesia about devices which would easily solve this weeks problem.
But there would be no tension or drama if the crew played full munchkin.
There's long long long lists of "forgotten technology" which is shown to work in one episode but which is never ever applied again.
A version of start trek that consisted of just the captain lounging in his chair having a pina colada while the latest borg attack is dismembered would not be fun to watch, there would be no struggle and enemies playing to an equivalent level to make for proper drama would make battles almost incomprehensible to an audience.