While I don’t see any encouragement on God’s part in the passage, I do recognize the fact that God must have known who was going to come out first.
But Jepthe must have know that he was promising to sacrifice a human, unless there are a lot of animals coming out of his house. And I Ning here in lies the problem. Both God and Jepthe know that a human is going to come out of the house, but perhaps Jepthe is counting on it being one of his servants that he is promising to sacrifice.
When you make a vow to give something to God, you need to expect to be giving your most precious, not most common, sacrifice.
As far as the morality of the passage goes, Father Barron - on YouTube - spoke about looking at the scriptures from the point of view of Christ. He referenced passage in Rev. That spoke of the seven seals on the scroll, the scroll being the The Bible, and the One to break the seals was the land standing as if wounded - Christ.
When it is put into this perspective, all suffering and all life takes on a different meaning. If the girl died, her suffering was justified, and her soul did not perish. We as men have trouble understanding sometimes that death is not the end, and is doesn’t even begin to be the ultimate in suffering. Jepthe made a kind of “unholy” vow and suffered for it, but he suffered justly - that is, he stuck to his promise even when it was his only child, the most precious thing he had, that he gave up. A vow to God is a vow to be kept.
It reminds me of David and the baby he fathered. When the baby fell ill and faced death he refused to eat and mourned his child and the “unholy” union that created it. But when the baby finally passed he quite his fast and moved on. The time for suffering was over, and the baby was now in peace, an end we all should hope for.