Motorcycles have been used throughout the military more than people realize. During the first World War, the U.S. was using Harley Davidson bikes both overseas and on the border of Mexico. Sometimes they were also used alongside a mounted cavalry unit during the Border War. The U.S. then shipped over 80,000 motorcycles to Europe for use by their militaries, including Harley 17 Fs and Js, and Indian Powerplus Big Twins. These bikes allowed for rapid deployment and enabled medics to quickly move from one location to another with a quicker dismount and park time than a four-wheeled vehicle. WWII saw less motorcycle usage, but they were still the vehicle of choice when it came to getting in and out of smaller spaces quickly. Comics and movies also portrayed the sidecar, usually driven by a Nazi while another one used a machine gun.
Source: https://www.hotcars.com/heres-how-military-motorcycles-have-changed-over-the-last-100-years/