Your first sentence is grammatically correct because the sentence is in the subjunctive mood, however many people, including native speakers, do not use the subjunctive mood correctly. In everyday spoken language, no one is likely to notice if you use the subjunctive incorrectly, however on a grammar test, only the first sentence is acceptable.
These verbs typically require the subjunctive in the clauses that follow them :ask, demand, determine, insist, move, order, pray, prefer, recommend, regret, request, require, suggest, and wish.
See this website for an explanation: http://englishplus.com/grammar/00000031.htm
Here's an explanation: http://englishplus.com/grammar/00000031.htm