Feet tend to smell if they are closed up in a space where they can not breathe. This is why you will find they smell in closed shoes but not in flip-flops.
When it comes to the socks you wear, make sure to get socks that allow your feet to breathe to avoid smelling. Materials such as polyester do not allow your feet to breathe unless blended with other blended fabrics.