I couldn't go to school because of illness.

Literal

Illness [because-のため] couldn't-attend-school.

登校できなかった — 登校する is a compact suru-verb meaning 'to attend school' (literally 'to go up to school'). Subject omitted. Very concise.