Reform UK's Matt Goodwin came second to the Green Party's Hannah Spencer in the Gorton and Denton by-election, with Labour in third.