I think the "moment the ball is played" means the last touch, not a previous one. And it covers Casemiro standing in an offside position when Fernandes passes towards him but someone else scoring without he, himself becoming "active".
Pretty funny I am trying to justify this decision as I think the offside rules are unneccesarily complicated. To me, Casemiro should be offside in the spirit of the game.
"I think...". This is the problem. The laws are unclear. They are open to interpretation, and funnily enough, the interpretations always seen to favour certain clubs.
Ironically, I think Casemiro should be onside in the spirit of the game. He fell during the attack and was only offside because he fell. He then got back up, got himself onside, and was onside when Fernandes laid the ball off to him. He wasn't seeking to gain an advantage.
Spirit of the law or strict interpretation of the law? When certain referees are deciding, apply whichever gives the best outcome to the preferred team.