I think its important for us to show a united front. I think many of his actions derailed that. Yes, Trump is of course to blame that too. I think if McCain would have let him come to his funeral, it would have sent a much stronger message to the American people.
That tweet was not needed and just make us look bad. Then again, so are most of Trump's tweets, but no one is arguing that point.
All in all, John McCain lived a great life and served his country with dignity. May he RIP.
Your argument is that he did certain things which were wrong in order to build a legacy. Think about that. It means that he didn't carry water for Trump to build a legacy, because in future, with the benefit of hindsight, going against Trump will be a legacy but toeing party line for the sake of partisanship would be seen as the wrong thing to do?
In other words, when faced with a choice, on one side doing something politically expedient, on the other "building a legacy" - the legacy is obviously the choice of integrity. Even if your motive is a legacy, it's still the right choice!
Of course, he could be wrong. But he still chose what he thought was the correct path, not the politically expedient one.
When Obama did the Iran deal, was it necessary then to hold a united front? And your refrain about Trump attending the funeral is proved more and more absurd seeing Trump's efforts to denigrate McCain at every opportunity since his passing.
Trump being at the funeral would be a national disgrace.