The decision was 7-2, which means two liberal justices - Breyer and Kagan - were part of the majority.
The Little Sisters filed their suit in 2013. The USSC granted an injunction in 2014 suspending penalties while the case made its way through the courts. In 2016 the USSC overturned lower courts' rulings against the Little Sisters. The 2017 HHS rule simply codified what the USSC found in 2016.
DUmmies hating on religious freedom is utterly unsurprising.