A General Weighting Theory for Ensemble Learning: Beyond Variance Reduction via Spectral and Geometric Structure