If anyone here remembers 2016, the vast majority of people, especially in Europe, believed that Trump's chances of winning were miniscule and that he was a joke candidate who only ran to satisfy his ego, not because he even wanted to become president.
If Assange, like basically every other journalist, believed that sabotaging Clinton's campaign was essentially impossible, then it provided a great opportunity to showcase corruption and gain support for his cause.
Additionally sitting on documents and dropping them closely before elections is a very common tactic. In the same way you would have to condemn the top AfD candidate being confronted with allegations, which the leakers had known for months, very shortly before the EU election. Certainly not any coincidence.