理由 (logic + cause): justification; argument; reason
原因 (origin + cause): cause; reason
When stating a 理由 (reason) for an action, you need to explain the justification, logical argument for the action
When stating a 原因 (reason) of action, you need to state the origin or cause of the action
Example:
秦儈殺岳飛的理由是'莫須有'
The reasons (justification) for Qin Yu to kill Yue Fei was 'no need to state'
He didn't have any justification so he just said it is not necessary to have one
~
秦儈殺岳飛的原因是為了迎合高宗
The reason (cause) of Qin Yu killing Yue Fei was he wanted to cater to the Emperor (Gao Zong).
Gao Zong's father and brother were the two previous Emperors captured by the enemy. Yue Fei wanted to defeat the enemy was a good thing, but he also wanted to save the two former Emperors and bring them back home. Gao Zong could not openly object to that, but everyone knew having the former Emperors back would endanger Gao Zong's status as the Emperor. Qin Yu wanted to please Gao Zong was the cause of his action
Simpler examples:
開除他的理由 The justification (reason) for him to be fired
開除他的原因 The cause (reason) of he being fired