Spencer - who joined the Whites from Sunderland in 2019 - has signed a two-year deal in West Yorkshire which will run until the summer of 2023.
The 17-year-old has been a regular for the Under-18s this term in the second half of the campaign after his return from injury.
Spencer has made 10 Premier League 2 appearances for the club, scoring two goals and notching three assists.
He also featured for the club in the FA Youth Cup and found the back of the net against MK Dons in an 8-2 victory.
Spencer joins fellow youngsters and Thorp Arch teammates Charlie Allen and Max Dean in signing professional terms in recent months.