Actually it's Biblical. I forget the exact quote, but I remember something on the order of "If your brother dies, take his wife unto yourself". It doesn't matter if you already have a wife, either.
Yes, it is part of the Mosaic law. However, the children produced are to be considered those of the dead brother.