Constructing Linear Codes with Good Spectra