From which perspective? I think it's a good deal for everyone involved; Mata gets more playing time ahead of the World Cup, United get a world class players in an area they lack and Chelsea get rid of a player who was surplus. He won't play against Chelsea this season, he won't play in the Champions League and Mourinho probably thought that United wouldn't come near them again.
From Mourinho's perspective. It makes sense for this season, but if Mata is the decisive factor that gets United to qualify for CL football, Mourinho will have helped United becoming a title contender again next season. If they failed to qualify, they would probably struggle to get any big name signings in next window. If they don't, which seems more likely with Mata, this will also help them attract some otherwise potentially unrealistic targets, perhaps even some Mourinho himself would be interested in, like Gündogan. So yes, it doesn't harm Chelsea in the title race this season and there even is a chance that Mata might help United taking points off of Chelsea's direct rivals, but will strengthen them to be competitive again next season. As for Rooney, his price would go down in summer, United wouldn't be in the driving seat as much anymore. Seems a bit short-sighted to me, but knowing Mou, he will have a plan.
Having said that, of course Mata doesn't guarantee them Champions league Qualification, but he makes it more likely.
Good signing but is Mata the player United need right now?
No. Seems like a bit of a panic buy considering that Moyes refrained from signing Özil because he "didn't need that position". The squad is the same, so it's more about having nothing to lose and taking a world class player that is available. Could be different if Rooney leaves, but not sure about that. CM or defence would be much more important imo, especially considering United will have to find a whole new system to fit Mata in.