this is concerning. What reasons did he give for voting against these or not voting at all?
If I remember correctly the Russian sanctions Bill also included sanctions on Iran for no reason, which Bernie was rightfully against.
I don't think that this explanation is right at least for the Magnitsky Act, which Sanders was one of 4 senators to vote against in 2012 (Others: Sheldon Whitehouse of RI, Jack Reed of RI, Carl Levin of Michigan). The Magnitsky Act does not contain any stated sanctions against Iran or Iranians, it was specifically targeting Russian oligarchs and their over-seas holdings. There were 18 primary targets of the Magnitsky Act, all of whom were Russian or Eastern European. There have been sanctions applied on other individuals with the Act since it was passed, notably on Saudi's responsible for Jamal Khashoghi's murder. The 2017 Russian sanctions bill passed the senate 98-2, and Sanders' justification for joining Rand Paul in opposing it was that he argued that it threatened the Obama-era Iran Nuclear Deal. No other Democrats agreed with Sanders on that, neither the senate nor the house (the House passed the bill 419-3, with the 3 nays being Republicans -- Justin Amash, Duncan (TN), and Massie), but those were his motives, personally I don't think he's right there, at least every Democrat in government in the House and Senate voted Yes on the bill.
Sanders never revealed at the time why he voted against the Magnitsky Act because he was a relatively unknown Independent. It's also worth recalling that in Obama's first term, the Administration was trying to soften the relationship with Russia. Diplomatically Democrats were interested in pursuing a "Reset" with Russia, and Republicans were generally skeptical of the Clinton-led "Russian Reset." The more progressive left generally viewed sanctions against Russia and other countries as punitive, and tools for American imperialism or interventionism abroad. Jill Stein was notably against sanctions as well, though this was prior to her really being known as a "useful idiot" of Russian foreign diplomacy ... She was most known as a recurring candidate for Governor in Massachusetts under the Green-Rainbow Party. Likewise with Progressive 2008 candidate Mike Gravel, who widely opposed international sanctions.
The Obama Administration originally opposed the Magnitsky Act (or the sanctions it recommended) as well, but eventually got carried into it by public support in light of Russia's continued crack down on human rights, and military aggression towards the West. Mitt Romney used Obama's opposition to Russian sanction bills against him in the 2012 election, when Obama finally defended his actions by, now somewhat infamously, chiding Romney that he was stuck in the past with his perception of Russia and that "The Cold War called and it wants its foreign policy back." The line was considered a zinger for Obama in 2012 and helped him get back on track after a poor first debate performance, but 4 - 8 years later it's not really the zinger we thought it was then.
We don't actually know why Sanders voted against the Magnitsky Act, he wasn't asked because he was a junior senator, but it wasn't because of Iranian sanctions. If we had to guess it was likely because the progressive foreign policy du jour was against international sanctions at the time. Sanders prides himself on his ideological consistency, and in 2012 it would be consistent that a progressive independent might oppose sanctions to Russia, even as Russian clearly acts antagonistically and would heighten that antagonism since.