It doesn't force it up, theres just nothing that black can do. No matter where black's queen goes, there is a checkmate and the king cant move, and if he pushes the pawn, Qd1 is mate
Basically, sacrificing the rook puts the white pawn on the same file as the black pawn so that no matter what the white rook does, the black pawn cannot be stopped from promotion.