'If you're missing photos or videos in the Photos app' on a mobile device, click here --> https://support.apple.com/HT205912
This probably happened because both devices were actively signed into iCloud Photos when you deleted them. If they are both active then what you do on one with iCloud will also be done on the other device. You can probably recover them using methods in the document to which I provided a link.
If you want to delete photos on the old phone, there's various ways to do this, including being part of generally setting up a device for a new owner or recycling. Alternatively, at least make sure you sign out if iCloud Photos on the old phone before you manually delete items.
Change your iCloud settings - Apple Support
What to do before you sell, give away, or trade in your iPhone, iPad, or iPod touch - Apple Support