I just learnt that plants photosynthesise during the day and respire during the night. Why don't plants just respire all the time? Is it because photosynthesis is a better process to get energy?

Photosynthesis is the process in which sugars are produced from CO2. Sugars are then the starting point of energy production through anoxic (without oxygen) respiration and oxic (with oxygen) respiration.

Both plants and animals need to respire in order to produce energy. The main difference is that animals need to acquire sugars from their food, but plants can manufacture their own.

Plants are actually always respiring. It's just that, respiration in plants (O2 consumption) is much lower than the rate of photosynthesis (O2 production) that overall, O2 production wins out. That's why you only notice plant respiration at night when photosynthesis is pretty much dormant.