During trafficking through tissues, T cells fine-tune their motility to balance the extent and duration of cell-surface contacts versus the need to traverse an entire organ. Here we show that in vivo, myosin IIA-deficient T cells had a triad of defects, including overadherence to high-endothelial venules, less interstitial migration and inefficient completion of recirculation through lymph nodes. Spatiotemporal analysis of three-dimensional motility in microchannels showed that the degree of confinement and myosin IIA function, rather than integrin adhesion (as proposed by the haptokinetic model), optimized motility rate. This motility occurred via a myosin IIA-dependent rapid 'walking' mode with multiple small and simultaneous adhesions to the substrate, which prevented spurious and prolonged adhesions. Adhesion discrimination provided by myosin IIA is thus necessary for the optimization of motility through complex tissues.