If you observed carefully, Ryuk never intends to help Light at
all. Both of them do things their own way. Ryuk was just enjoying
himself while watching the fight between L and Light. In the end,
Light loses, and therefore Ryuk knows that it's useless to go on
anymore, and thus decided to end Light's life himself.
What I cannot understand is, why L will write only 23 days in the
notebook when he could have write 10years and die 10years
later.