There are several buildings in which Wolf Link can't go, but he'll follow you inside if you get too close to the walls. This is simply a precaution against clipping errors that could corrupt your saved file or game data. It's only a minor inconvenience, and it will not happen again once you leave the building.