One challenge in engineering a scalable system for quantum computation is the control of errors due to the unwanted coupling of qubits with their environment. Sophisticated schemes for error correction and avoidance have been devised, but these generally involve significant additional resources (e.g., qubits and logical operations) and/or complicated logical encodings. Here, we investigate how the compilation of a quantum algorithm into primitive gates can impact the error rate. In particular, we leverage a geometric understanding of the quantum search algorithm to show how the gate implementation can be improved in the presence of a collective, dissipative coupling of the qubits with their environment. This is shown via simulation of the algorithm via a quantum master equation for small numbers of qubits. While our approach is specific to the search algorithm and the specific system-environment interaction, it illustrates the importance of gate design in determining the error rate.