If he had a starter profile, they make that deal regardless of the health concerns. The fact that he's most likely limited to the pen (where yearly performance is highly volatile), maybe makes a prospect with the upside of everyday MLB 2b a little more valuable?
Yes, they need pitching today, but I don't think they made that trade for what the team would look like this year or next.