Flat throw vs 45 degree throw of a ball
45 degree angle for a projectile gives you the maximum distance in a vacuum, but air resistance, as pointed out, changes that a little. With air resistance slowing the ball, you need to to throw a tick under 45 degrees for maximum distance.
Also, since you throw from above the shoulder, not from the ground, the ball is usually thrown a foot or more above the altitude where it's caught and that shaves another degree or two off the optimal angle for distance, so optimal distance, I'm thinking maybe 40 degrees - as a guess.
I agree with Jakethesnake and I suspect your coach is just teaching what he was told when he played baseball and he's not a student of physics. When you throw straighter, it's a faster throw and that's the desired outcome in what is sometimes referred to as the game of inches. You want to hit the cutoff man or the 3rd baseman, not throw the ball as far as you can.
So, yeah, your coach gets an F in physics, but he knows his baseball.
I am a baseball fan (and a physicst), and your coach is misleading you a little. First, in the absence of air resistance, a 45-degree launch will get the ball there with miminum energy expenditure. But not, as the other answers suggest, minimum time. And time matters. A lot. :-)
Your coach should also be telling you to plan your longer throws such that they bounce once before reaching the destination (typically direct to homeplate), for the same basic reason of minimizing elapsed time. The speed lost due to the bounce causes a time penalty much less than the time it takes to throw a ball in a high-enough arc to reach home on the fly. The tradeoff between direct throw and one bounce depends on the distance and the absolute strength of the outfielder's arm.
It's worth noting that a few third basemen (originally a certain disgraced gambler) will throw a one-bouncer to first base for the same reason.
Why does my sports coach tell me that when I'm fielding I should throw the baseball 'flat' to get the maximum distance? I thought from physics that you get the most distance from throwing at a 45 degree angle?
The second question first, this is true if you are a robot throwing a ball on the Moon (no atmosphere) that releases the ball at the same speed regardless of the release angle. You are a human, not a robot, and you are throwing the ball in the Earth's atmosphere rather than on the airless Moon. You need to account for physiology and realistic conditions. When you do that, you will find that the optimal angle is well under 45 degrees. The initial velocity of a baseball thrown by a human depends on release angle; the highest speed releases are with throws that are close to horizontal. This alone drops the optimal angle to less than 40 degrees. Presumably you are throwing the ball overhand. When you release the ball it will have a good deal of backspin. This gives lift. Accounting for lift and drag drops the optimal angle for maximum distance even more, to 35 degrees or less.
Now for the second question. While your coach's reasoning was incorrect, his advice was spot-on. Your goal is not to throw the ball as far as you can. Your goal is to get the runner out. You will not get the runner who started at first or second base out with a long-distance throw if the distance to home plate is at the very edge of your throwing capabilities. The time aloft will be far too long, and just as importantly, your accuracy will be lousy. You'll be better off throwing to the cutoff man.
Check out this list of eight phenomenal baseball throws made from deep in the outfield at http://www.hardballtimes.com/a-physics-comparison-of-great-throws-from-years-past/. All have three things in common: They were incredibly fast, incredibly accurate, and thrown at a rather low elevation angle, from 5.9 degrees to 14.3 degrees.
This is a physics site, so I'm going to pitch a website dedicated to the physics of baseball, http://baseball.physics.illinois.edu. This is written by an emeritus physics professor at UIUC who also is a big fan of baseball.