Law 11.3: An opponent can only put a player onside of he: 1. Runs 5m with ball 2. Kicks or passes the ball 3. Intentionally touches the ball.
Scotland claimed the ball came off an Australian. It is clear the ball was knocked forward in the collision between Sco and Aus player. However as neither player intentionally touched the ball, the Scottish prop was still in an offside position and deliberately played the ball which is a penalty!
Good decision ref!