Numerous answers have been suggested; in the “answers section” of Iyun HaParasha #31 (http://hebrewbooks.org/49783, pages 74-85) 22 approaches are presented. I would like to focus on Rashi’s second answer (which, for some reason, is not included among those 22).
After quoting the M’chilta, which says that the problem wasn’t praying for help but the length of the prayer, Rashi (paraphrasing one of the many other approaches brought in the M’chilta, but with significant differences) seems to be saying that prayer was inappropriate in this situation because it was “upon Me” (G-d). The implication is that in most cases it is not “upon G-d” to make what we want happen, but up to us, so asking G-d to help us succeed is appropriate; in this situation, though, it was only G-d’s responsibility, and His alone, to get the nation out of their dangerous predicament, so prayer wasn’t warranted. However, aren’t all situations ultimately in G-d’s hands? Why was this one be different? Additionally, since one of the purposes of prayer is to help us acknowledge that G-d is the Source of everything (as evidenced by the fact that we are asking Him for the things we think we need), why wouldn’t it be appropriate to ask G-d to save us, which would emphasize the point that He was the Source of our salvation?
There is a profound difference between most situations we find ourselves in, and the situation the Children of Israel were faced with as they were camped by the sea. Although everything is under G-d’s control, there are many “indirect” factors (referred to as “mikreh”) that contribute to the various situations we are faced with in life (seehttps://rabbidmk.wordpress.com/2015/01/01/parashas-vayechi-5775/). Our own choices (whether those choices lead to G-d directly punishing us or to our being in a less than ideal situation based on not deserving divine protection) also contribute greatly to creating a situation where we need help from G-d, help that is far from guaranteed. Under these circumstances (which applies to almost all situations), asking G-d for help is both appropriate and necessary, as ideally we wouldn’t be in this predicament, and we weren’t purposely placed in this situation by G-d, unless it was specifically meant as a wake-up call (in which case turning to G-d for help is likely the best first step anyway). In the specific situation where Moshe was taken to task for praying, on the other hand, everything had been purposely and specifically set up by G-d in order to save the nation from Egypt.
G-d took us out of Egypt, and purposely led us into the desert heading towards the Sea of Reeds (Sh’mos 13:18), leading us with His “cloud pillar” (13:21) to the specific locations where He wanted us to go. This included a slight retreat to mislead Pharaoh, in order to get the Egyptians to chase after us (14:1-4). When these things were all put into place, the end result was that the nation seemed trapped between the sea and the Egyptians. Nevertheless, knowing that G-d had purposely led them into this situation, the proper response should not have been to panic, and therefore cry out to G-d for help (even if the proper response to panic is to cry out to G-d), but not to panic, instead trusting that G-d had something planned, and they were therefore not in trouble.
The nation had also cried out to G-d (14:10), but they weren’t taken to task for doing so, since they didn’t have first-hand knowledge of what G-d’s instructions were, and did not have full confidence that Moshe was following G-d’s instructions (rather than it being G-d who was complying with Moshe’s requests). After all, they didn’t fully believe in Moshe until after the Egyptians had drowned in the sea (14:31, see K’sav Sofer, see also https://rabbidmk.wordpress.com/2013/01/24/parashas-beshalach-5773/). Moshe, on the other hand, knew that this situation had been specifically and precisely part of G-d’s game plan, so he shouldn’t have been concerned about the predicament, just waited for G-d’s further instructions (or ask G-d what to do next, see Ramban on 14:15). Crying out to G-d at this point was inappropriate for Moshe, and further eroded any confidence the nation had that G-d had taken them to this point. If G-d had told Moshe to go to the exact location where they were, and purposely tricked the Egyptians into coming after them and facing them there, why was Moshe worried about what might happen?
[Although Ibn Ezra prefers to understand this verse (14:15) to also mean that it was the entire nation crying out (because Moshe himself shouldn’t have been concerned), most understand the singular version of “cried out” (in 14:15, as opposed to the plural version in 14:10) to refer to Moshe the individual, not the nation.]
Here too, despite Moshe being fully aware that G-d had purposely put the nation in the situation they were in, he beseeched Him to save them, as if they were in trouble, rather than trusting that this was just part of His plan and awaiting further instructions. And for this, he was reprimanded.