Because they are undermining the foreign policy. Even if they will have the right to change it in the future, if at the time a person was talking to Russia, the sanctions were in place, talking to Russia about ignoring the sanctions would be undermining the current administration. Its the exact same complaint that Trump has now, saying Obama people are undermining his administration through leaks.
In terms of Flynn, I think McMaster was a nice upgrade over Flynn. Flynn got fired by the Obama administration for being a pain in the ass (his subordinates complained about him, he had a reputation for like publicity). He was able to turn that into a positive with the Trump people by creating the narrative he was relieved of his position one year early because he was a dissenter. However, in like a month, he created three problems for Trump, which kind of indicated he was going to be a pain in the butt for Trump. He talked to Russia about the sanctions, he didn't disclose income he received from Russia on his financial disclosures (which because he would have been a huge story with the media, except when that came out he had already designed) and his excessive use of twitter by him and his son was troublesome including his son, who he took as a chief advisor with him, tweeted about pizzagate. So to replace Flynn with McMaster who even most Democrats admit is a good choice was a huge upgrade. Sometimes it takes two tries to get something right.
Obama had no business sanctioning Russia. It was BS to begin with.