We consider a multiple-access relay network where multiple source nodes send independent packets to a common destination with the assistance of multiple relay nodes. We assume that the relay nodes are equipped with multiple antennas and are allowed to choose either spatial multiplexing (SM) or transmit diversity (TD) in sending network coded packets. We verify the performance limit of conventional MIMO network coding and propose two optimization schemes to overcome this limit. To this end, we develop an integrated design methodology that jointly optimizes the redundancy offered by network coding at the relays and channel coding at the sources as well as the spatial redundancy offered by multiple antennas in order to minimize the end-to-end outage probability. We show that such joint optimization can provide a significant energy saving.