How can I transfer all my songs to iPhone instead of just purchased songs?
There are multiple ways to get around this issue, and I've detailed one below. Before trying that, though, see if this solves your problem:


Select the iPhone in the iTunes sidebar. Go to the Music tab and look at what music is syncing.
I expect maybe only the "Purchased" playlist is syncing, and that's why. If that's the case, simply select  and you're set!


Here's the other fix, if that doesn't work:


Select the iPhone in the iTunes sidebar. Find the tick box that looks like this:  and make sure it's checked.
Go to Music in the sidebar and select everything (Tip: ⌘ (command or control) A!).
Drag everything to your iPhone.