How do I properly wire this outdoor junction box?
From experience an extra wire with a different shield color might indicate it as the "Positive" wire in a circuit (or Hot). The electrician may have been planning ahead and to save time ran the extra wire. What I would do is to pick the most likely route of the yellow wire starting from the  opened junction box. I believe you said there was a spa circuit included in this box; start there. I'm guessing that the yellow wire my be for the spa motor. Possibly a speed or rotational direction setting. Or an accessory that has been removed. Either way a safe accurate diagnose/ repair includes a DVM.