My personal feeling is that the USA wanted to neutralize him in such a way that they didn't have to actually ever take custody of him and the negative publicity that would entail, and that Mr. Assange's sense of privilege handed the CIA an opportunity on a silver platter. Whether they set him up, or just dug up existing dirt on him and made sure it became public knowledge is an open question, but the second case requires far fewer assumptions to hold based on what we know now, and is therefore the more likely one.
The spy game isn't like the movies kids: it's a results oriented business, and sometimes your targets personal failings are actually your biggest assets.
"I don't believe in sweeping social change being manifested by one person, unless he has an atomic weapon." -- Howard Chaykin