For many people, it's too complicated (as in, they don't know how) to transfer a photo into their computer and then upload it separately. Integrating a camera in the app is far easier.
Nowadays you can trigger the camera app from a website and get the image data directly in your web, making the experience of uploading a photo the same as any installed app.