The S&P 500 and Nasdaq finished June on Tuesday with their biggest quarterly gains since 2020 as investors remained upbeat about economic and earnings growth even amid the Middle East conflict. The Dow had its biggest quarterly jump since 2022. The indexes ended higher for the day as well, with the Dow registering a record closing high for the second straight day. Technology led gains among S&P 500 sectors, and an index of semiconductor stocks finished 3.9% higher on the day. Optimism…