Depends on your mail provider, but pretty sure the way it's working is correct. IMAP, which most services use these days, keeps the mail on the servers. Delete in one place, deletes everywhere.
Now, most services will keep trash around for 30 days or more, so can always refile deleted emails to Inbox or some other folder.
Only other thing I can think of is that the Mac was maybe originally setup to use POP for email fetch, which has options for "delete from server" when the mail is pulled down, and phone probably set to IMAP, which would "delete" the emails off the phone since it does not see them on the server after downloaded to Mac. Can check your mail provider support pages to see if they still offer POP, and what those settings are, and then can reconfigure the settings on the Mac mail account to use POP.
Personally, I'd keep it like it is. If you lose the Mac or have a disk failure, all your old email is lost.