Because they are still better at certain things and people who carry on the job usually aren’t limited to one rifle/sub gun for everything.
I’m on a medium sized city SWAT team and have a 10.5” AR or MP5K-PDW to choose from, I previously had an UMP45 instead of the MP5 and other memebers still carry it.
I average making entry once a week on drug search warrants and much prefer the MP5 for this role. This is because the MP5 is shorter than the AR even with the stock collapsed (I prefer it extended) and lighter (current setup: AR has a Daniel Defense rail, fixed FSB, Aimpoint, light...MP5 has a light and no optic). When clearing tight spaces every extra inch of extension makes your gun feel like a musket and any extra weight, at least up front*, makes one handed handling more difficult (between opening doors, directing suspects, etc this happens frequently). Before getting the MP5 I often only carried my pistol because the UMP** and AR weren’t as maneuverable. The MP5 is also easier to exit vehicles with quickly.
As far as lethality, I’m confident in 9mm within the CQB distances and despite often finding body armor I’m yet to encounter anyone wearing it. Thugs generally have body armor for making their rap videos and robbing other thugs in my experience. Also, head shots with an MP5 at CQB distances aren’t difficult if an armored suspect is encountered.
Now, when dealing with barricaded suspects and possibly extended standoff distances I choose my AR. If I were forced to only have either an MP5 or 10.5” AR I’d choose the AR because it is more versatile and I have many more years of training on it but I’d miss my MP5 for 90% of entries.
However, I’m currently demoing a 16” barrel X95 and like a lot of its characteristics for my purposes on the SWAT team. It’s only about an inch longer than the MP5, has 16” barrel ballistics, a comfortable length of pull for me, and despite not being as light as other options the weight distribution is to the rear which makes it shooting one handed incredibly natural (see * above).
** As configured, our UMPs are as front heavy and as long as our ARs.