D&D 5e gives you 27 points to buy six ability scores. The cost table is not linear, and that is the entire design.
Scores from 8 to 13 cost one point per step: 8 is free, 9 costs 1, up to 13 costing 5. Then it changes. A 14 costs 7 rather than 6, and a 15 costs 9 rather than 7. The last two steps cost double.
The second rounding step
The score is not what you roll with. The modifier is, and it is floor((score − 10) ÷ 2), which throws away half the information.
A 12 and a 13 both give +1. A 14 and a 15 both give +2. Every odd score buys you precisely nothing on its own, which means a 13 is a 12 that cost an extra point and a 15 is a 14 that cost an extra two.
Stack the two effects and the 15 is expensive in a way the table hides. Going from 13 to 15 costs four points and raises your modifier from +1 to +2. Going from 10 to 12 costs two points for the same +1.
What that does to the obvious build
The instinct is to max your primary stats. Three fifteens and three eights costs exactly 27 and looks optimal. Add up the modifiers and you get +2, +2, +2, −1, −1, −1, for a total of +3.
Now spread it. Six twelves costs 24 points, gives +1 six times, and totals +6, with three points still in hand. Spend those three on one stat to reach 14 and the array becomes 14, 12, 12, 12, 12, 12 for exactly 27 points and a total of +7.
That is more than double the modifier of the maxed build, from the same budget. The point buy calculator will confirm the costs; the standard array of 15, 14, 13, 12, 10, 8 comes to +5, sitting between the two.
Why nobody plays the flat build
Because total modifier is not the objective, and this is where the maths stops being the whole answer.
Your attack rolls, your spell save DC and most of what you do every turn come off one stat. A +3 in your primary ability is worth more than +1 in each of three abilities you rarely roll. Characters are not optimising a sum, they are optimising a particular entry with the rest kept above embarrassment.
What the arithmetic does tell you is where the waste is. If you are going to end on an odd score, you are paying for a modifier you do not get, and that only makes sense if something else is going to bump it. Racial and background bonuses are exactly that something: a 15 plus a 1 is a 16 and a real +3, which is why 15s are bought in the first place. Buy an odd score only when you know what is going to make it even.
The other half of a character
Hit points follow the same preference for the boring option. At each level you either roll the hit die or take its fixed average, and the hit points calculator defaults to the average for good reason: summed across a dozen levels, the distribution is so concentrated that rolling is almost pure downside. You risk a lot to gain very little, which is the same trade the point-buy table keeps offering you.
For why the dice themselves behave that way, see the piece on dice variance.