He realized the backlash he was getting for disrespecting the flag/military. His pig socks that then came out didn't help his cause.
Taking a knee in sports represents respect for the other players/team. Like running out the clock as not to run up the score or when a player gets injured at younger levels.
Why he did it, who knows.