I forgot to remove password expiration flag and I got the following error when I was removing it:
Msg 15128, Level 16, State 1, Line 1
The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON.
The solution is to change the password using the following query and then remove the flag.
ALTER LOGIN MyLoginName WITH PASSWORD='mypasswordgoeshere'