Create custom entity type programmatically
As some have commented, Entities are VERY complicated. The reason your code is not working is because entity_create() is used to create an INSTANCE of an entity of an already defined entity type. What you are doing in the UI creates the entity type.

You must first create your entity type in your module before you can create an instance of that entity. Refer to the links in the comments above on how to do this. And get ready to spend a little time if this is your first time doing this -I assume it is.