I've been trying to set up two step verification on my Galaxy S8 and it's a royal pain in the butt.
I've opened up the window, entered the phone number and EVERY single time I received the verification code via SMS it would just restart the whole process. I've tried it so many times it said the wrong verification code has been entered too many times and that it would call me and dictate the code via a phone call. Same thing, enter the given code, it takes me back to the start screen. Three attempts and now it tells me that I need to wait because there have been to many wrong attempts made...
This is insane.
This solved it for me on a Samsung Note 8:
Instead of starting Samsung Health, I went to Settings → Accounts and Back up → Accounts → tapped on my Samsung Account → Password and Security → Two Step verification, and enabled it there. There I got the text message right, it auto-entered it, I pressed the button, and then it was saved and done.