Ed25519 key generation
The second step has nothing to do with the first step. It doesn't matter which hash is used in the first step. For X25519, which operates on an equivalent curve Curve25519, the private key is obtained by randomly generating 32 bytes and the first step of using that key is to apply the bit pruning step (clear bits 0, 1, 2 and 255 and set bit 254).

Clearing bit 255 ensures that the key is in the range $0..2^{255}-1$ where the operations are defined. Setting bit 254 improves performance when operations are implemented in a way that doesn't leak information about the key through timing. Clearing the low-order bits counters attacks that force the use of a weak key.