When you are using iCloud Photos on your iPhone and your iPhone and your Mac, iCloud Photos is automatically syncing all changes to the photo library across all devices, to keep the Photos Libraries identical on all your devices. If you delete a photo from your iPhone, it will be deleted in iCloud as well and also on your Mac. Otherwise your Photos Libraries would no longer be identical and in sync. Also, any photo you take on your iPhone will automatically appear on your Mac, any photo you import on your Mac will appear on your iPhone.
If you do not want the Photos Libraries on your iPhone and your Mac to be kept in sync and identical, you should not use iCloud Photos, as the syncing across all devices is the main purpose of iCloud.
Why are you using iCloud Photos? What do you want to achieve?