Hi,
I know I'm joining the topic real late, but until today I had the same problem on my MacBook Air. Every time I logged in, it kept on asking me to type in my iCloud password. But, since it wouldn't seem to recognize it, I was forced to "cancel" the request, consequently giving up on using iCloud sync for things such as the Notes app.
But today I tried something, and it worked, or so it seems, since the MacBook regained the iCloud synchronization, so I thought to share it with y'all, hoping it'll work.
What you have to do is create a specific password for iCloud, which DOES NOT mean to choose a new password for your iTunes and iCloud accounts. You have to go to your Apple ID webpage (here > Apple - My Apple ID ), log in and clic on "choose a specific app-password" (mind that I GUESS this is how the option shows up in English – I'm Italian and so I have it in Italian, that's just my translation. But the concept is this). Then, in the pop-up box, when it asks about the app you want to create a specific app for, you write "iCloud" (no quotation marks), and it SHOULD (I had to try it twice because the first time it gave me an error) create a specific password you'll have to type in the box when you log in.
And that's it!
I gained my iCloud synchronization, and everything until now is fine. So I hope this can help you! 🙂
As far as I think I know, this is related to two-step authentication option.