The possible reasons why a hamster doesn't sleep may include the following points:
Environmental Factors: Hamsters are nocturnal animals. They usually are active at night and rest during the day. If you try to change their sleep schedule, it may have an adverse impact on their health.

Dietary Problems: If a hamster's diet contains too many high-calorie foods such as sunflower seeds, peanuts, and mealworms, it may cause internal heat, which in turn affects its sleep. Symptoms of internal heat include yellow urine, eye discharge, and so on.
Health Condition: If a hamster feels unwell or is sick, it may also have trouble sleeping. At this time, you need to observe whether the hamster has other abnormal manifestations, such as a lack of appetite, reduced activity, etc.
Emotional and Psychological Factors: Hamsters are sensitive animals. If they feel stressed or uneasy, they may choose to sleep in a corner to avoid human attention.
Suggestions for Improving a Hamster's Sleep:
Adjust the Diet: Avoid overfeeding high-calorie foods. Appropriately add cooling and heat-clearing herbs like chrysanthemums and honeysuckle flowers, or feed mung beans and fresh fruits and vegetables.
Provide a Comfortable Environment: Ensure that the living environment of the hamster has a suitable temperature (20-28°C). Avoid direct sunlight and strong winds, and keep the cage clean and quiet.
Observe the Health Condition: If the hamster shows abnormal manifestations, you should adjust its diet in a timely manner or seek veterinary advice.
Give Sufficient Private Space: Hamsters need their own "little world" to relax. Avoid disturbing them frequently.