We have just had an entire thread recently on why churches are closed during the day.
It is likely that the church in the city may have staff around daily and/or may have more Masses, prayer groups and other activities during the day. Some city churches are run by religious orders who have their members present in/ around the church all day; some city churches are also very busy during the day because of the population density (such as a lot of office or hospital workers who attend noon or afternoon Mass) and because various groups use the city church as a base for meetings and charity activities. Your local church might not have a lot of people around it during the day, and thus it’s prudent to lock it. You can ask the priest if you want to know the reasons why.