Supposedly, it's because of the insane amount of R4 and clone cartridges produced in China and how they want to control their market segments (They don't want Japanese people importing cheaper American versions of games like how Fire Emblem Awakening is $40 here, but like $70 when converted in Japan) or something of the sort.
I wish region protection wouldn't exist since it is limiting the amount of games I can play on my device. Hopefully, a region free solution like Freeloader or an exploit comes about soon.
I'm not sure if they've ever released official word on why, but one oft-cited argument is that importation of games "cannibalizes" sales in different regions (for example, if a game comes out a year later in EU the sales for that region will be drastically lower because people will have already imported NA or even JP versions of the game).
This wouldn't be a problem if companies bothered to actually localize things in a timely fashion, without removing content or breaking the game with bugs.
No idea if the region lock has anything to do with piracy, I'd think that would be a separate issue.