We don't know if it was legal or not. If there was an agreement to go easy on Russian sanctions in exchange for dirt on Clinton, and that comes out, Trump is finished.
The optics of it were terrible. I know what your reaction would have been had Chelsea Clinton met with a Kremlin-backed lawyer to get dirt on Trump.
Why would Trump himself make that deal? For what, the emails were already coming out and everyone knew it.