You can go to Settings > General > Auto-Lock and make sure it's set to 1min. You can also go to Settings > General > Accessibility > Assistive Touch and use that to turn off your Phone.
But I would suggest a Restore to Factory Settings using iTunes, to make sure it's not corrupted software. Before you do that make a back up but after you Restore to Factory Settings set up as new to make sure it's not your information that's causing it.
Make a Backup Using iTunes or iCloud:
https://support.apple.com/en-us/HT201252
Restore to Factory Settings using iTunes:
https://support.apple.com/en-us/HT203977
But if your still having issues with the Button I would suggest making an Apple Store Appointment or Contacting Apple to be set up for repair for the button.