StarFleet is a Hybrid of a:
- Military Organization
- Exploration Organization
- Scientific Research & Discovery
- Engineering Corp
- Diplomacy Service
- Whatever the UFP & StarFleet Upper Brass comes up with to assign to it's Captains.
If that means being a Diplomatic/Cargo Transport for important diplomats, so be it.
How many times have we seen a StarFleet StarShip carry diplomats from point A to B?
So, it is the US military.