Obama’s goal is to weaken the US. He’s fully aligned with Iranians — he believes the US is the Great Satan. Therefore, his foreign policy reflects his goals and is working fine from his perspective.
He promised Putin flexibility after his last election, and we are witnessing what he meant. His loyalty is not to America. This is deliberate. He is taking America down to be replaced as a super power.