Wanting to avoid paying licenses by doing your own implementation is perfectly legal and moral. Let's say we lived in a world where there were no Open Source RDBMS, and you didn't want to pay Oracle's license. There would nothing shady on you deciding to develop your own RDBMS.