Why does the clock stay at high?
The I2C clock should be 1 when idle. Refer to the I2C stop condition. If you use a bit-banging function, Google existing examples, don't reinvent the wheel. And of course it's always better to use on-chip peripherals.