OK, then a bit German MilHistory here.

The German army had several military motor sports events (air forces had them as well) during the 30's. One of these events happened in 1938; expert drivers (often test drivers from the factories) were driving very agile, light (300 ccm) motorcycles and triumphed.
The army bought such light motorcycles and heavier ones (500ccm) - the heavier ones were necessary for sidecars anyway. The picture looked rosy in peacetime.

The war in Poland happened and motorcycles proved to be OK. The war in France happened (a few weeks longer, but better roads) and again motorcycles were OK.

Then came Barbarossa, and within a few months the motorcycle inventory crashed (as did the inventory of captured civilian trucks from France and almost all Czech design trucks). The light models were completely unsuitable and many models (even 500ccm) were simply not durable enough.
750ccm motorcycles arrived, but their price was comparable to a Type 82 Kübelwagen (lighter jeep equivalent), so their inefficiency was obvious. Some types of 500ccm and the later 750ccm motorcycles proved to be irreplacable in the war for couriers, but their other roles were diminished.

Then came the 50's Bundeswehr, and the first motorcycles bought were very, very light ones; nobody expected a long WW3 (at least not for Germans) and we (Westerners) also expected to fight in Central Europe with its fine road network.

The enduro type appeared, and some medium enduros were introduced during the Cold War (and a newer model after the CW) - the power output had to be reduced in order to make the engines more durable (typical with post-WW2 military motorcycles).

The increasing confidence in radios (and satcom) and increasing personnel budget pressures have even led to a 80% reduction in motorcycle strength in the Bundeswehr.


Could motorcycles be used as specialty vehicles, just in case? Maybe. I guess it doesn't happen because of their many limitations.


Motorcycles have a moderate efficiency as transportation vehicle.
Vyou cannot leave one man behind who could move transport vehicles for 10 men into safety if necessary - unlike with a truck.
They're loud.
They don't stand a good annual training rate (and mistreatment by drivers who do not own the bike) well.
Very few of them can drink diesel or JP8.
The chains require maintenance and oil and do not tolerate mud and dust well. Cardan shaft models have often gearbox durability issues.
Some roads eat up motorcycle tyres as if they were designed for this purpose (Belgian highways can ruin a motorcycle tyre in 200 km!).
There's no way how motorcycle troops could transport spare wheels without sidecars (~ATV then) and run flats don't work properly on a motorcycle.
Motorcycle tyres are never compatible with car or truck tyres (even ATVs use different ones).
Motorcycles exhaust their drivers in off-road driving quite quickly, especially the heavy ones (and everything beyond 400ccm is quite heavy).
Motorcycles have almost always inferior road ranges in comparison to cars.
Motorcycles do not offer protection against adverse weather.
All-wheel drive is very rare among motorcycles (practical examples appeared only a few ears ago; only up to 17% of power on front wheel) despite being able to reduce the skill requirements for the driver very much.
You need a helmet which provides good crash protection for riding a motorcycle, especially if you're a bit tired (as soldiers are quite often in wartime). There are few motorbike helmet designs which double as ballistic protection.
...
(There are more problems, but I'm too tired at this time.)