Lens Flare is completely normal when photographing at night with lights. But they can also be reduced or eliminated. Before you took the photos, you could see them on your iPhone screen. You likely didn't notice them. Angling the camera differently could have completely eliminated them.
Below are two photos. In the first photo of lights on my deck, you'll see lens flare above the lights:
Without moving my feet or location, by angling the camera and watching the flares, I was able to take a photo, without lens flare:
You are the photography and it's up to you to notice things like flares when taking night photos. Taking the time to angle the camera better, will help you capture photos with little to no lens flare. But to expect your camera to fix this isn't going to happen. Even my Nikon DSLR, which costs appreciably more than my iPhone with a fast lens, which cost even more than the camera captures lens flare at night against lights.