Hello 706gb,
We're going to assume you are referring to passcodes used to unlock your iPhone and not a password used for your Apple ID or some software.
Setting a passcode on one device should not cause it to be applied to the other device unless you synced over the settings from one to another during a data transfer. This article explains how to add (as well as remove and change) a passcode on your iPhone: Set a passcode on iPhone - Apple Support. Follow those steps to adjust the passcode on the devices as you wish them to be.
Let us know if we can help with anything else at all or if this doesn't settle your issue so we can look into this further with you. Thanks and have a fabulous day!