What regulations were put in place to enforce this? I'm honestly curious, as it seems like tourist dollars would be a significant boon to many local economies.
Tourist dollars matter, but not having the hospitals overwhelmed matters more. There are lots of little border communities where the people on both sides are begging both governments to let them be a "bubble community" so the people can have access to essential services, schools, shopping, banking, support local businesses, and so people can actually get to their own countries if the only overland route means crossing into another country. To the best of my knowledge, the answer has either been "request ignored" or "request denied."
It's controversial to have barriers between provinces, because it goes against the Charter that guarantees us freedom of movement within Canada. But the Charter can be overridden when it comes to public safety. That said, there are plenty of border communities between provinces where the tourism industry is suffering (in Alberta and BC, particularly). Places in BC depend on Albertan tourists, and some of those places are divided on whether to welcome Albertans who cross over the border or run them out of town. Having a different license plate can mean being bullied, harassed, assaulted, your vehicle vandalized, and so on. I don't condone this, btw, and while our respective provinces have political differences on several significant issues, the people themselves usually get along fine. I've actually seen more of BC than I have of Alberta and most of my favorite places are there.
When it comes to closed borders between countries... sorry. But the Americans have had a government that hasn't paid attention to the science and whose "leader" has openly mocked the scientists and medical professionals and sabotaged reasonable efforts to get the pandemic under control. Closing the border to American tourists doesn't mean we hate Americans. We just don't want the virus hitching a ride in with them, and that means they can't come here. I know it means blaming everyone for the actions of a relative few, but that's how it is. Cutlass is not an essential worker, he's not a Canadian citizen, he doesn't have permanent residency status, and that's why he won't be allowed in - or at the very least, won't be allowed to sightsee. He'd be expected to get back to the U.S. by the fastest, most direct route, and have as close to zero contact with Canadians as possible.
Essential workers, like medical personnel and truckers hauling stuff we need, are allowed across the border. Tourists are not essential workers. Therefore, they're not allowed in unless, for instance, they're residents of Alaska traveling overland. And even then, they're to take the most direct route and avoid tourist areas like Banff, Jasper, and various places in BC. The ones who are caught are given hefty fines.
In fact, there are folks here who don't think the Alaska-bound Americans should be allowed in anyway, given that there's a way to get there by boat from somewhere in Washington state.