The underlying issue, during a time of war, was that Northern Ireland shared an open border with the neutral Republic of Ireland. The UK authorities were understandably anxious that enemy spies etc could sneak into a part of the UK without detection. Part of the measures to counteract that was a requirement for the population to have a National identity card, or an aliens registration card.
For the same reason there was a border control on ferries and flights between Northern Ireland and the rest of the UK. So you needed to show a passport (or your National Identity card) to travel on the ferry from Larne to Stranraer, or to fly from Belfast to London etc, between 1939 and 1951, or thereabouts.
I am not entirely sure what the situation was for a citizen of the Republic of Ireland travelling to Northern Ireland but to travel to Britain, for part of the war, an Irish passport and a visa (or certain specified alternative documentation) was required. There was a passport control at Holyhead, Liverpool etc to check the documentation.