Adam Wallis, 29, went to Queen Alexandra Hospital in Cosham in the early hours of September 7.
He tried to see his girlfriend in the middle of the night but was told he could not, Portsmouth Magistrates’ Court heard.
Prosecutor Graham Heath said police were called but that Wallis said he ‘wasn’t going to listen to the police officers’.
But he was arrested at 1am and was not released from custody until about midday.
Wallis, of Elmhurst Road, Fareham, had rushed to see his girlfriend as she was having emergency medical treatment, the court heard.
He now ‘fully accepts he reacted in a way that he shouldn’t’, after being told that he could not see his girlfriend, the court heard.
Portsmouth magistrates fined Wallis £254.
He must pay a £30 victim surcharge and £385 costs to the Crown Prosecution Service.
Wallis admitted being drunk and disorderly.