Also, I think LWJ was still very much in his “conflicted” phase with respect to the Lan sect rules and morality. He knows that helping WWX and the Wen remnants is the right thing to do, but he also respects his clan rules and elders and believes them to be morally just. In this context, taking WWX to the burial mounds and then leaving makes a twisted kind of sense: Here LWJ is trying to have it both ways, where he breaks the rules to do what he believes is righteous and then turns around and submits himself to the punishment that his clan believes is righteous.
(Which, not coincidentally, mirrors the time in their school days when LWJ submitted himself for punishment for breaking curfew or for drinking even though he wasn’t at fault. But diving into LWJ’s relationship to the rules and punishment during his childhood would be another entire essay.)
In my interpretation, it’s only after WWX dies alone, besieged in the Burial Mounds while LWJ is incapacitated due to his punishment, that LWJ truly comes to understand that he can’t have it both ways. If he believes that his actions are morally just, then the Lan rules and elders must be wrong, full stop.
As evidence for this, look at how LWJ acts after WWX’s death. He spends all of his time night hunting, “going where the chaos is,” to the tutting disapproval of the clan elders. He openly allows the lan juniors to have boisterous fun against the rules. He refuses to show even the slightest bit of courtesy to JC or other sect leaders he hates, even when doing so would put his brother and the Lan clan in a difficult diplomatic position. He evidently no longer cares about the opinions of the elders or the letter of the rules and is instead guided by his own internal sense of morality.
After WWX is resurrected, LWJ admits to him that he regrets not standing by his side before, and I think that he is specifically referring to not being there during the siege. Because that, for LWJ, was the true turning point in his relationship with his clan and its rules. Trying to both do the right thing and obey the rules lead to the death of his soulmate and all that he was trying to protect. And it was only after losing everything that he cared about that LWJ was finally forced to face the full hypocrisy of his clan and their rules.
So yeah, from an outside perspective, it seems insane and irrational for LWJ to leave WWX in the Burial Mounds and submit to punishment. But at this point in his character arc, LWJ is insanely irrational because he is trying to forcefully reconcile two incompatible worldviews.