It is just an assumption of the model that firms behave as price takers, i.e. as if they have no effect on price. Each firm is assumed to act as if they can sell as much as they like at any given price. Of course, if one firm increases its output and the other firms keep their outputs constant, it will not actually be the case that the price will be unaffected, as the market clearing assumption implies that the market price adjusts with changes in total output. The assumption of the model is just that each firm ignores this when choosing its output.
To turn things around, do you have a problem with the assumption of the perfectly competitive model that consumers behave as price-takers? The more a given consumer demands, the higher the total quantity demanded. The market clearing assumption then implies the price must change (go up if the supply curve is upward sloping). However the assumption of the model is that each consumer ignores this when choosing their consumption. (There are models where consumers are not price-takers, i.e. models of monopsony and oligoposony. These are demand-side equivalents of monopoly and oligopoly.)
If each firm were to take into account the effect of an increase in its output on the market price then that would be the Cournot model (of quantity competition), which is a model of oligopoly. In the Cournot model, as the number of firms goes to infinity (entry costs go to zero), the outcome approaches the perfectly competitive outcome (pricing at marginal cost).
The assumption of price-taking is simply to capture the situation where each producer is so small relative to the market that any reasonable increase in their quantity has no effect on price. This can be formalised mathematically by assuming a continuum of firms. In this case there are infinitely many firms, each producing an infinitesimal amount.
Another rationale for the price-taking assumption of the perfectly competitive model (at least in the case of identical constant marginal costs) is as follows. If each firm were to choose their price (rather than quantity) and consumers went to the lowest-priced firm(s) (as in the Bertrand model of competition with identical products), then the only equilibrium is that all firms price at marginal cost. This is the same outcome as under perfect competition (regardless of the number of firms).