Why do we need ports with IPv6?
As Zac67 already said, it was intended to make IPv6 as compatible to IPv4 as possible to ensure that existing programs need not to be changed too much.
Keep in mind, that in IPv4, the destination port of a TCP connection also specifies the type of higher-layer protocol:
80 for HTTP, 443 for HTTPS, 23 for Telnet and so on.
So we need the TCP port in IPv6 as indication of the higher-layer protocol type if we want to be compatible to IPv4.
Why not assign each application, tab, etc... its own public IPv6 address
I was already thinking about this: Doing this would allow implementing certain additional security and privacy features. So I can imagine that this will actually be done in the future.
And of course: We can get rid of URLs like
https://example:8443/: Instead of using different ports (8443) on server side, we can simply use multiple IPv6 addresses.
However, it would still not allow us to get rid of the source port of a TCP connection:
I rembember some web-based application that requires two HTTP(S) connections to be established between the client and the server at the same time.
In this case, the server will surely check if both connections come from the same client (this means: same source IP address).
However, this means that both connections have the same two IP addresses and the same destination port (443 in the case of HTTPS). Therefore, they must have a different source port.
And if IPv6 should be compatible with IPv4, this web-based application must work the same way with IPv6 as it works with IPv4.