The temple opens once you have done what the red guard asks and brought him the right berries.
Start by talking to the red guard and following his instructions. Then head to Petpet Plaza and pick the purple saiberries — the ones that look like little purple lanterns. You will find them on the tree at the far end of the plaza, the one standing closest to a shop.
Two things trip players up: picking the wrong colour of berry, and harvesting from the nearer tree. The lanterns are distinctive once you spot them, so scan for the purple glow rather than grabbing whatever is in reach.
Bring them back to the guard and the way in should be clear.