Your post hits the nail on the head. There is absolutely no justifiable reason for these agencies to have these types of units in their organization, or even to be able to contract for these types of units from the private sector.
Their militarization is a violation of the intent of the Posse Comitatus Act,
and they know it. They’ve intentionally circumvented that law in order to form an intimidating domestic government enforcement military.