I suppose because there is evidence AI can go rogue on a massive scale that precautions should be taken but there is no inherent reason this should be so. I could also foresee benevolent or indifferent AI as possibilities.It's
It's stated in at the end of 'Such sweet sorrow' Starfleet made sure to completely eradicate what remained of Control in the 23rd century. It also stated in Season 4 after Zora was realised to be sentient, that Starfleet places limitations on their A.I. So they obviously learned something from having a homicidal A.I go rogue.
Ultimately Starfleet does have a right to decide what is on its vessels and who/what can make decisions for them, but I would also hope they wouldn't assume negative AIs every time, same as they assumed genetic engineering would always be evil.
Luckily, both SNW and Discovery have both questioned these ideas with Una and Zora episodes. Picard on the other hand had some dumb, offhand dialogue about networking their ships being like the Borg...Huge face-palm.