He was making a pass to his teammate, but missed and accidentally scored.
The shot was initially not noticed by either the referees or by the players, so the opponents began their own attack. But Ginobili started signaling actively, stopping the game, allowing the referees to look at the recording of the shot. At first they thought it was a two-pointer, but after watching the replay, they acknowledged that Ginobili had scored a three-pointer.
The San Antonio Spurs defeated the New York Knicks in this game with a score of 100 to 91.