A leftover of horse buggies and sailing ships. In this modern world of satellite videoconferencing, heads of state can just talk to each other on substantive issues and don't need Ambassadors except to oversee the consular office running visas.
There is a technical term called disintermediation, meaning throwing all the between guys and gals under the bus.
Well, there are other uses for Ambassadors as on site representatives of the country which sent them. You cannot always be at the local Veteran’s Day ceremonies, but an Ambassador can. You cannot always be at the funeral of a state leader, but the Ambassador can. There does need to be an onsite rep so the other nation can see some kind of visual proof that we (the USA) cares.