Reasons to get a Pi: GPIO support, software support, OS updates, free root & bootloader, more flexibility and customizability, extensive documentation and support, consistency, simplicity, more ports, battery optional.
Used phones are good for tinkering, especially for "display with sensors and battery attached" usecases, but there are still plenty of downsides. And unfortunately Linux on phones is just not ready for primetime, last I checked.
Your phone has GPIOs inside it, but you can't access them without at least root.
PI was a thing when it was much cheaper than X86. You can buy a much better speced mini PC nowadays
I've never used one but android phones can use utilize USB GPIO devices which are very cheap