Why do folding bikes usually have MTB components?
Great question!

I think the market drives this -- not necessarily just the folding bike market, but the component market. 

Mountain bikes have been the predominant type of bicycle for the past thirty years. This has meant that every manufacturer has a line for very, very inexpensive mountain bike componentry. If you want to build up a bike on the cheap, you use mtb hardware.

Finally, related  is that most adolescent-size BSOs are also mountainbikes - which further drives down price on those components with the added benefit that they fit folding bikes better.

tldr: Most folding bikes are not sold by virtue of their component line (unlike road bikes) but on the basis of their folding mechanism. Most buyers will see "Shimano" gears and be happy -- not knowing it's the bottom end plastic Shimano for a BSO mtb. 



 There is also some physical factors that also play a role, notably the  brakes. Most folding bikes have 20" or smaller wheels. Because the wheels are smaller, the tires have to be wider to provide resilience and suspension. The brakes also have to be stronger and "grabbier" because the smaller wheel torques on the brakes more. So you want cantilever or V-brakes for the reach around the fat tire -- or disc-brakes.  Final nail in the casket, you have to consider which brake handle styles have the right pull ratio given that folders don't have drops. One of the few folding bikes that has road-style caliper brakes is the Brompton  - and it has custom brake levers and has been heavily criticized for its poor braking. One of the few folding bikes with drops and calipers is the Tern Verge X18 below, which is a niche-niche bike.  So in general, considering cost and effectiveness, you end up with mtb style brakes and brake levers.   Christian Lindig has also mentioned the derailleur but there are some considerations there (long-cage mountain derailleurs don't work on stubby wheels) that complicate a response.