There are technical reasons for why browsers do this and why changing it would have other consequences.
When loading a new URL, the browser doesn't know if the new URL will be a web page, a file download, or something else, until it starts to receive the response. The header of the response will indicate the file type and whether it should trigger a file download dialog.
If the response is a file download, the existing web page will remain in the tab and a file download dialog will appear in addition to it. Cancelling or proceeding with the download will continue to show the webpage in the tab.
Now, this behaviour could be modified, but it would mean that upon following a link the page would clear and go white while waiting for a response, and if the response is a file download the page that requested it will no longer be there - the browser would either need to continue showing it as a blank white page, close that tab/window, or trigger a "back" action and re-load the previous page. These would depart from established expectations.