Biological sensors have evolved to act as matched filters that respond preferentially to the stimuli they expect to receive during ecologically relevant tasks. For instance, insect visual systems are tuned to detect stimuli ranging from the small-target motion of mates or prey to the polarization pattern of the sky. In flies, individually identified neurons called lobula plate tangential cells respond to optic flow fields matched to specific self-motions, forming the output layer of what is presently nature's best-understood deep convolutional neural network. But what functional principle does their tuning embed, and how does this aid motor control? Here we test the hypothesis that evolution co-tunes physics and physiology by aligning the preferred directions of an animal's sensors to the most dynamically-significant directions of its motor system. We build a state-space model of blowfly flight by combining visual electrophysiology, synchrotron-based X-ray microtomography, high-speed videogrammetry, and computational fluid dynamics. We then apply control-theoretic tools to show that the tuning of the fly's widefield motion vision system maximizes the flow of energy from control inputs and disturbances to sensor outputs, rather than optimizing state estimation as is the conventional approach to sensor placement in engineering. We expect the same functional principle to apply across sensorimotor systems in other organisms, with implications for the design of novel control architectures for robotic systems combining high performance with low computational load and low power consumption.