@Hazumi28 My idea about this:
1) It costs a lot of time and money to train a librarian and probably check his background to prevent spies for this special library.
2) Also looks like novel takes place in something like medieval era so death on childbirth is pretty high, so such contract is created to not lose trained person without any preparations to have a replacement.
3) Exclusion created for royalty so probably continuation of royal blood takes higher priority.