Spectral precoding is a promising technique to suppress out-of-band emissions and comply with leakage constraints over adjacent frequency channels and with mask requirements on the unwanted emissions. However, spectral precoding may distort the original data vector, which is formally expressed as the error vector magnitude (EVM) between the precoded and original data vectors. Notably, EVM has a deleterious impact on the performance of multiple-input multiple-output orthogonal frequency division multiplexing-based systems. In this paper we propose a novel spectral precoding approach which constrains the EVM while complying with the mask requirements. We first formulate and solve the EVM-unconstrained mask-compliant spectral precoding problem, which serves as a springboard to the design of two EVM-constrained spectral precoding schemes. The first scheme takes into account a wideband EVM-constraint which limits the average in-band distortion. The second scheme takes into account frequency-selective EVM-constraints, and consequently, limits the signal distortion at the subcarrier level. Numerical examples illustrate that both proposed schemes outperform previously developed schemes in terms of important performance indicators such as block error rate and systemwide throughput while complying with spectral mask and EVM constraints.