Necessary to force the user to differ the new password from the old one?

I need to rewrite our password change dialog currently. It's designed to check whether the old password differs from the new password.

  1. Old password: something
  2. New password: something
  3. New password repetition: something
  4. Click on "Save" leads to error: New passwords needs to be different from old password

Is this really necessary and why?