Poker- Split Pot/ Tie Issues

In poker, if two players have the same winning hand, the pot should be split between the two players… however the game chooses the winner randomly.

Player 1 has: J, 5 clubs
Player 2 has: J, 5 spades
The board is: K, 5, 10, Q, A

Since both players have a J for the straight, it should be considered a tie and the winnings should be split evenly between the two. Instead, the winner is chosen randomly.