I think that Starwars and many other sci-fi just have incredible sized for their ships for no real good reasons other than just because, there are no real thought behind why they are the way they are. It become more like a contest in which lore have the biggest ships and that become tiresome quite fast in my personal taste. WH-40k are sort of the end of the spectrum here with their hulking cathedrals in space using VAST open space inside their ships...makes little sense but perhaps cool for cinematic effects. These ships are just meant to be cool and nothing else.
Eh, I won't contest the fact that WH40k is just trying to look cool
However regarding star wars, I was a fan of the extended universe lore (not the CRAP that disney made afterwards). I even have all the sourcebooks for the pen and paper RPG (which I used to play with friends).
In those, and keep in mind this is basically "official" material before disney came and ruined everything, there was a mission description for the various ship classes, and for battleship it read something like this:
A battleship is supposed to be a force strong enough to lay waste to most "normal" star systems on its own, carry enough troops to mount a credible offensive against a "normal" planent, bombard a "normal" planet into submission, act as a command and control center, carry a full wing of fighters into battle, have enough assorted small ships and shuttles for a variety of situations, and have enough supplies to stay operative for years.
That's a lot to ask from one ship. I would say that being 1km long or more is certainly warranted for all that. And it fits, considering it's literally a galaxy-spanning setting.
Now, I don't want to talk about realism when we're talking about sci-fi. But I don't feel it was for "big for no real reason"
But hey, maybe I'm a bit on the fanboy side of things here
Sorry, I derailed the thread