With the SPI, your code waits for Tx/Rx to complete. With the USART, your code waits for .DATA to become empty. The code doesn't wait for the USART to finish. Use USART_TXCIF_bm instead of USART_DREIF_bm.