The "black square" next to Keep Lines Together indicates the only a portion (not all) of what you have selected has the Keep Lines Together format applied to it. Clicking on the black box should turn it into a check mark (indicating ALL of your selection now has Keep Lines Together applied). Clicking the box again should remove the check mark. Click OK and the formatting should be removed from your selection.
As a note, when a paragraph formatting change has been made to something in Word, there is (usually) a small black "bullet" that appears to the left of the paragraph (or in your case table cell contents) as a visual indicator that some kind of change has been made from its default formatting:
That indication can help you sometimes when trying to troubleshoot formatting-related issues you may encounter.