I looked at the EXIF data for both your photos.
The top photo shows that you were using Program Mode, which selected settings of: shutter speed 1/60 sec, aperture f/3.5, and ISO 400.
The bottom photos was also in Program Mode, with settings of: shutter speed 1 second, aperture f/3.5, and ISO 400.
I'm not sure how much experience you have with photography (specifically, camera settings), so if my explanation is too simple, then I apologize in advance.
With flash photography, there are always 2 exposures going on in the photo: the foreground subject and the background. In your case, you want your flash photo to properly expose (1) your subject (the 2 girls) which is lit by the flash and (2) the background (the castle).
The flash helps with the foreground exposure. Your camera settings determine the background exposure.
There are several ways of achieving proper exposure (both the foreground subject and the background) in your flash photo. Whichever way you choose, you should end up with approximately the same camera settings for your photo.
First, there's a consumer-friendly, easy way of taking night pictures with flash. Your camera already has a "
Night Scene" or "
Night Portrait" mode:
Select this mode, and it should be set-it-and-forget it.
Second, you can try:
- put your camera in Aperture Priority mode (Av),
- set your metering mode to "Spot Metering" (the square with the dot in the middle),
- when you look through the viewfinder, put the center spot right on the castle (the camera will then measure the exposure for ONLY the castle and choose the camera settings)
- take your flash picture (I'm assuming that your flash is probably automatically set to "E-TTL")
Finally, if you're comfortable with Manual camera settings:
- start by adjusting the settings to get the the proper exposure for the castle. Based on the photos above, you can probably try 1/8 sec, f/3.5, ISO 400. However, if you're trying to get both the foreground subject and background in focus, you'd probably want a smaller aperture (larger f-number), like perhaps f/5.6, f/8, or f/11. That means that you'd probably increase your ISO up to ISO 800 or, if needed, ISO 1600.
- After you get the right settings for the proper exposure of the castle, you THEN add the flash. Set the flash to E-TTL, which is basically the "Auto" mode for flash. This should get you the proper flash exposure for your foreground subject. If it's too bright (ie. if your subjects are overexposed by the flash), try decreasing the Flash Exposure Compensation (FEC).
I think that any of the above steps should get you approximately the same camera settings for proper nighttime flash photography. Of course, I think the last option gives you the most control and the most creative control.
Again, sorry if this is all information you already knew. I'm sure others have better ideas. However, hope it helps.