In this paper, a cross-layer framework for joint distributed sensing, estimation and control in agile wireless networks is presented. A network of secondary users (SUs) opportunistically accesses portions of the spectrum left unused by a licensed network of primary users (PUs). A central controller (CC) schedules the spectrum bands detected as idle for access by the SUs, based on compressed measurements acquired by the SUs. The sparsity in the spectrum occupancy dynamics is exploited: leveraging the spectrum occupancy estimate in the previous slot, the CC needs to estimate only a sparse residual uncertainty vector via sparse recovery techniques, so that only few measurements suffice. The sensing probability of the SUs and the spectrum scheduling are adapted over time by the CC, based on the current spectrum occupancy estimate, and jointly optimized so as to maximize the SU throughput, under constraints on the PU throughput degradation and the sensing cost incurred by the SUs. A compact state space representation and decoupling of the state estimator from the CC are proposed: the estimator provides a maximum-a-posteriori spectrum estimate, as well as false-alarm and mis-detection error probabilities for the bins detected as busy and idle, respectively, based on which the CC performs scheduling and sensing decisions. Simulation results demonstrate improvements up to 11% in the SU throughput over a static sensing scheme.