He is credited because he produced and wrote the song, not for singing. It's him featuring Sia because he wanted her to sing on his music that he produced, rather than Sia asking him to produce a song for her, then it would be Sia featuring David Guetta. Although I guess it is a little bit unfair, because when for example Dr. Dre produces a song for someone else, he doesn't get credited at all, he only appears on the producers list. But I think it's because David Guetta gets more famous this way, and he has his own albums with songs that he produced and he collaborates with someone to do the singing (most recently his album 'Nothing But The Beat'). Other artists like this include Deadmau5, Afrojack, Swedish House Mafia (although I've heard that they've split up) and others who's albums you can buy, but they don't actually do any of the singing, they just produce and write the songs and get other people to sing on them.
Me, I hope I helped!