The reasoning behind this has been a problem for many to understand for...well, since Android first came out. The phone is yours, however the ability to use it on a network is licensed to you by the cellular carrier and they control what level of freedom you have to run which phones and various ROMs and such. The reason is very complicated but in a nutshell it is possible (very possible), that a third party ROM will cause the phone to operate poorly (or not at all), and also that it may cause problems on the cellular network for the carrier(s). The double-problem winds up falling right into the laps of the cellular carrier. They are the ones who suffer the brunt of punishment when things don't work the way an end-user expects.
A phone that won't work right is frustrating for an end-user and increases customer service calls and technical support needs. This also creates what is very often false claims on blogs of how poorly a specific carrier's network is functioning "because my phone won't work right on it but my friend's phone works fine on XYZ carrier's network". So the problem of not working properly for the end-user becomes a thorn in the side of the cellular carrier and reduces or impinges on profitability as well as reputation.
Then there's the other end of the spectrum where phones with flawed ROMs and/or KERNELs create communication issues on the actual cellular network, gumming up the system and causing the carrier even more technical issues to deal with, now at the central hub(s)/switch(es) and/or at the tower(s). Again this adds to operating costs and reduces or chips away at profitability. Not only that, but this can also result in other end-users' phones suffering limited connectivity as well. So the problem can mushroom into a bigger problem for not just you and the carrier, but also others in the immediate and surrounding areas as well.
We have to remember one very important thing about these cellular carriers...they're regulated which means they must meet certain government imposed standards, else they could suffer everything from a minor slap on the wrist in the way of a fine, all the way to being prosecuted and convicted of breaking some law and/or putting other innocent persons in harms way. Since the law says every phone MUST be able to call 911, even if it has NO cellular service, if by some fluke a custom ROM or KERNEL somehow disrupts the 911 service or prevents access to it for even just one person, the results could be catastrophic and life and limb could be in jeopardy.
It's not much different in some ways than being able to make, buy or customize a "vehicle" such as a car or motorcycle, and making it dangerous enough to be a potential hazard to you or others. So the "vehicle" is not "street legal", and the law will prevent you from properly registering and operating it on public roads. Also, law will even go to the extent of making certain "modifications" completely illegal to purchase or obtain, and so - like the carrier(s) in effect, they are preventing you from doing what you please to your vehicle, even though you own it.
I am all for rooting and unlocking these phones, and for flashing all manner of cool modifications, but I would not want what I've done to my phone to create a potentially harmful situation for others on the same "roadway". So yes, it's your phone, and if you weren't able to connect to a cellular network the manufacturers and carriers could care less what ROMs or KERNELs you flash into it. Unfortunately there is really no way to prevent you from doing this, so the only way they can protect the network and its other users from potential harm is to lock them down.