Your temple was glitched due to world generation (theres weirder things that can happen in minecraft with world generation)
Herobrine isn't real, it was a hoax to increase publicity for Minecraft. How do we know this? Because theres no feasible way how theres a glitch where a unique skin and a unique user can randomly spawn into players worlds. Sorry bud. But Mojang themselves have even said it was a little joke that every few updates they'd put "removed Herobrine" into the patch notes.
It was a hoax started by some players, mainly because theres no actual way a glitch like that could happen.