With a regular final consonant, the ending makes the contrast visible.
لِيَفْعَلَ — so that he may do.
This is لامِ کَی; the imperfect is in the nasb/takhfif state and ends with fatḥah.
لِيَفْعَلْ — he should do.
This is لامِ امر; the imperfect is jussive/akhaff and ends with sukun.
Do not identify the lām alone. Read its meaning and the ending of the verb together.