It looks like our villain Claudius has done the right thing. The priest was persuaded to preside over an actual ceremony that he clearly objected to because the king insisted. If the king had not intervened, the priest would have had her thrown in a pit far away from any churchyard. And the priest would have definitely preferred that.
This is from my modern perspective, of course – and what I think of as a respect for Ophelia’s humanity. At the time, perhaps this move of Claudius’ is more proof of his willingness to subvert religious laws. He kills his brother, he hurries Polonius’ funeral rites and he’s sanctified a body that the priest thinks is a suicide. But to my eye now, that seems like a kindness to Laertes, who mourns her. Which – you know – points to a calculation on Claudius’ part. He may have persuaded the priest, not for Ophelia, but to keep Laertes from rioting again and staging another coup.