I don't have any unique insights into why he was nominated, what's the likely short-term and long-term playout, how one should think about it from various normative perspectives, etcetera.
But just thinking about it strategically, it's an interesting and multifaceted play. For example:
Suppose we think of the entire nomination process here as a zero-sum game. Under this framework, a new Supreme Court justice who is younger and further to the left (within the relevant ideological range) is always good for the Democrats and bad for the Republicans, in pure mirror-image fashion, and vice versa for older/further to the right.
Likewise, insofar as both sides are interested in effects on the November election, since only one side can win the presidential election or any particular senatorial election, once again it's zero sum unless we tell a more complicated story (e.g., involving Trump, factions within a given party, or longer-term relationships between particular politicians and their constituencies).
By naming Garland, Obama has given the Republicans an option that they might actually benefit from exercising. We've already heard about the possibility that the Republicans might want to confirm in the lame-duck session, if Hillary wins the election and especially if the Senate turns. It's not clear that they would actually have this option, but there are scenarios in which the Republican side - whether or not the actual Republican senators making the choice - would benefit from exercising it pre-election. For example, they confirm him because they can see the electoral writing on the wall, or because they're at war with Trump as well as the Democrats, or to save endangered Senate seats.
Insofar as it's a zero-sum game, good for one side means, by definition, bad for the other side. And one can only benefit from having an option, if one would exercise it properly given one's true interests. So, under this framework, Obama's giving the Senate Republicans an option that their side might actually benefit from exercising in some scenarios can only be bad for the Democrats, as a necessary implication of its being good for the Republicans.
Conclusion: there are two possible explanations for Obama's decision to give the Republicans an option they might actually benefit from exercising. The first is that he doesn't think of it as purely zero-sum. This could reflect, for example, his stake in being the person who got to make a transformative nomination. Or it could reflect his long-held preference for moving Washington politics in a less confrontational direction (although the last seven years have obviously been disillusioning for him), or a personal taste for being and looking reasonable even if it doesn't bring positive results.
Second, he could think that the Senate Republicans are unlikely to use the option rationally from their side's perspective. Such a failure on their part, in turn, could reflect either their own irrationality, or else agency costs in relation to their base (reflecting the point that, even if the outcome is worse from their side's perspective if obduracy hurts them in November and/or leads to a younger and more progressive choice, at least they wouldn't be blamed for it by the proponents of always fighting and never compromising).
Though logically in tension, these two explanations are not mutually exclusive - one could easily have both of them in mind.