It looks as if John McCain is drawing on 'safe' liberal issues -- ones that appeal to middle-of-the-roaders. 'Don't Ask, Don't Tell' is one of those issues that are the least consequential, but the most discussed.
By supporting it, McCain alienates few conservatives, but will snag voters who want to see that he's not a cookie cutter conservative. They like he speaks his own. Here, he gets to come across as an independent thinker, yet safely within the realm of what is acceptable.
He'll have enough difficulty gaining conservative votes with his prochoice views. His Iraq position, more pro-Bush than anti, will earn him conservative points. This here, the 'Don't Ask, Don't Tell' gets him in the news, talked about in the venerable NYT, garners fresh votes, and offends few.
see: McCain Backs ‘Don’t Ask, Don’t Tell’ in the New York Times