Built in feature, because in most cases you want the camera to stop if you're going off screen. Not a lot of 2d games have "infinite" boundaries, most have hard border where the player is stopped. Having the camera stop and not show something "outside" the room is the desired functionality for most users.