What are the advantages and disadvantages (if any) of making sure that all pages validate compared to having non-valid HTML that however works on all major browsers?

Also, is having valid HTML after Javascript executes just as important?