The interference from clutter and active electromagnetic equipment deteriorates target detection performance greatly. In this paper, we design a MIMO radar transmit matrix to improve target detection performance in the presence of interference. To this end, we model the design problem by maximizing the signal to interference ratio (SIR) with the constraints of spectrum compatibility and constant modulus. To solve the resulting complicated optimization problem, the hierarchical approach is employed to convert the original problem into two subproblems, i.e., transmit design for sidelobe interference suppression and signal design for target detection under mainlobe interference. The first subproblem is solved by a novel anti-sidelobe-interference algorithm named as hybrid beampattern synthesizing (HBS) which can achieve lower nulling levels than the well-known beampattern synthesizing methods. The second subproblem is solved by two steps composed of energy spectrum density (ESD) design and signal design via the proposed hybrid ESD matching (HEM) algorithm which can balance the matching loss and the spectrum compatibility more flexibly than the existing ESD matching methods. Numerical examples verify the advantages of the proposed algorithms and that the designed MIMO radar transmit waveform can achieve higher output SIR than the traditional waveform.