In a geographically distributed population, assortative clustering plays an important role in evolution by modifying local environments. To examine its effects in a linear habitat, we consider a one-dimensional grid of cells, where each cell is either empty or occupied by an organism whose replication strategy is genetically inherited to offspring. The strategy determines whether to have offspring in surrounding cells, as a function of the neighborhood configuration. If more than one offspring compete for a cell, then they can be all exterminated due to the cost of conflict depending on environmental conditions. We find that the system is more densely populated in an unfavorable environment than in a favorable one because only the latter has to pay the cost of conflict. This observation agrees reasonably well with a mean-field analysis which takes assortative clustering of strategies into consideration. Our finding suggests a possibility of intrinsic nonlinearity between environmental conditions and population density when an evolutionary process is involved.