We can try to explain solar system formation through mathematical models and simulation (Phobos and Deimos would be clues) but we can't go back in time and find the real explanation. No law of physics mandates that Mars' rotational period should be similar in magnitude to Earth's.
On the moon it means you need enough solar power in batteries to power your gear, and to power appropriate spectrum lighting for plant growth.
If you can rely on solar power more reliably, then you can construct (significantly more complex than those required on earth) green houses which still benefit from natural light.
I actually agree that there are numerous challenges associated with very long days and nights. Artificial lighting per se is not among them. Solar power is a reasonable one.