Think of iCloud as a hard drive and your devices are accessing it from there. If you delete it from your device, it deletes it from iCloud as well. It's more of a sync than a backup.
If you are running out of space on your device, go to Settings > iCloud > Photos and enable "Optimize iPhone Storage" which will keep thumbnails of photos on your device and the hi-res on iCloud only. Recent images will be stored on your device while older ones offloaded in favor of the smaller sized thumbnails. When you look at an older photo, it may need to download before you can see it full res.